tht13 / html-preview-vscode

A HTML previewer for Visual Studio Code
MIT License
44 stars 22 forks source link

Some styles are not applied #6

Closed warpdesign closed 5 years ago

warpdesign commented 7 years ago

I am working on a (very very old) webpage which has styles set as attributes on the <body> tag, like:

<body bgcolor="#ffffff" ...>

And these are ignored, so the page doesn't really look the way it will in a browser.

av-src commented 7 years ago

There is no way to change body background property, nither through bgcolor, nor through css background property. They are just ignored.

This is because they are overrided in static/header_fix.css, wich has hardcoded:

body {background: #fff !important;}

tht13 commented 7 years ago

This is because the editor has a default transparent background. I can change the css to target the html tag if that helps people?

GuardianMajor commented 6 years ago

I know this have been posted a while ago but as it is not marked closed or resolved, I thought I add my concern here rather than a new issue for a similar issue.

I just installed this and the HTML preview is not an accurate representation of the code which unfortunately makes it hard to rely on. One of the most obvious issues is the background colors and a few other things not being applied, despite being inside a linked CSS file.

Any way to update the rendering to actually produce the results faithfully to the HTML code AND the accompanying CSS files. For quick and basic stuff, it does the job but not enough to rely on as a true representation of what it looks like in the browser.

Thanks in advance, and a great start, well done.

Apologies: This might seem indelicate but I found another solution that actually performs exactly as expected and seems a lot faster and so far seems to honor high fidelity. Live Server Preview on GitHub Repository - Just placing this here in case it helps someone and since the development here seems to have been stalled or possibly no longer maintained. Thanks.

tht13 commented 5 years ago

Setting the bgcolor is now possible, the default background color of body is transparent in v0.2.4