The live server on VS Code CSS is working. But when I open the index.html file directly the CSS not working - 100% Solution

The live server on VS Code CSS is working. But when I open the index.html file directly the CSS not working - 100% Solution


Tweet Link:- https://twitter.com/emselimahmed/status/1388548481237741568?s=20

Yesterday, I got stuck. And I post some social site about this problem. Only one people help me from Twitter. Use Twitter to help when you get stuck. Thanks.

Problem:-

The live server on VS Code CSS is working. But when I open the index.html file directly the CSS not working.

Solution:-

if you have a 

- CSS>style.css 

- Images>sample.jpg 

- Index.html

1. Check the image file path from your CSS file like this "background-image: URL(../images/sample.jpg)"



2. Check the CSS link up from your index.html like this "css/style.css"

3. Check the CSS link from the index.html file like this "href="css/style.css" 



Attention:- Never use slash (/) before folder. 

Let me tell you one thing "The more you stuck, the more your learn"


#100DaysOfCode #bootstrap #emselimahmed #VsCodeLiveServer #CSSworking #ImageNotShowing

Post a Comment

Previous Post Next Post