Haider Ali
Haider Ali

Reputation: 9

My Visual- Code-Editor is not showing the included CSS in the Live preview

I just reinstalled windows on my computer. The problem here is that when I was using the visual code editor before reinstalling windows with the live preview extension and it ran perfectly, but now after I installed windows the VC do not give me live preview like before. It is just showing the HTML structure and not the linked CSS and Javascript files. There is no styling and formatting being shown on the page even though the page displays perfectly on the browser, tried everything but nothing worked. Note that both windows versions are the same no changes in them.[Only HTML shows up][1]

[no definitions found said by vs code editor also]

Upvotes: -1

Views: 5997

Answers (3)

Akash us
Akash us

Reputation: 9

If have mentioned the css file as following example

    <link rel="stylesheet" href="style.css"

make sure the css file and the html file is on the same file directory, then it will start working, it started working for me.

Upvotes: 0

Mithun Wijayasiri
Mithun Wijayasiri

Reputation: 112

Yes, it only shows the HTML preview without CSS. You have to use "Live Server" extension for that.

Download that from here: https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer

GitHub Source: https://github.com/ritwickdey/vscode-live-server-plus-plus

Preview:

enter image description here

Upvotes: 1

Emlf9
Emlf9

Reputation: 131

does a .vs code folder appear ? This problem happened to me once and by deleting the file everything went back to normal. IDK if it will work for you but it worked for me.

BTW there is a Youtube video on that topic, here it is a video for CSS files not working on live server

Upvotes: -1

Related Questions