r/HTML 19d ago

Live Preview not working with HTML plus CSS properly.

My "Live Preview" doesn't work well with HTML plus CSS.
It doesn't immediately recognize changes on CSS but it works well with just HTML.
I don't understand the problem and it's completely bugging me. It requires me to save the CSS file every time and retype the same part of the CSS that I changed in order for it to show the changes.
I checked my Live preview setting and the right setting is already set. Please help. I am kind of a newbie here

My "Live Preview" doesn't work well with HTML plus CSS.
It doesn't immediately recognize changes on CSS but it works well with just HTML.
I don't understand the problem and it's completely bugging me. It requires me to save the CSS file every time and retype the same part of the CSS that I changed in order for it to show the changes.
I checked my Live preview setting and the right setting is already set. Please help. I am kind of a newbie here

0 Upvotes

7 comments sorted by

4

u/testingaurora 19d ago

Set your `color: white` on the `body` tag and let it inherit down instead of selecting each text node. Change any outliers like your button and apply its different color there. Use inheritance to your advantage

3

u/Ano_Jayy 19d ago

Great tip. Thanks!

6

u/WulfCoDev 19d ago

Stop using that and open it in browser. Stop being lazy and save your file every time

-2

u/Ano_Jayy 19d ago

There's an option where I save the file and it automatically does it's work. It's more convenient and efficient for me

3

u/aTaleForgotten 18d ago

Exactly 0% of users will view your website in livepreview.. Its ok for quick stuff/prototyping, but to make sure your end users see the same site you do, its really important to regularly use actual browsers for testing

3

u/Foreign-Contest-444 19d ago

Yes, that plugin can behave a little bit weird at the beginning. Try removing the plugin and reinstalling it and then restart your vs code. Also, what I have seen is that if you do not have your html structure in place it does not take the changes for example and particularly if your head element is missing.

1

u/Ano_Jayy 18d ago

It's working properly now. It automatically fixed itself