Inline styles don't get applied.
hrj opened this issue · comments
Given something like this:
<html>
<body>
<div>
<style> body > div {border:4px solid #555} </style>
</div>
<body>
</html>
... the style doesn't get applied. Moreover, the text of the style
tag gets shown in the output.
Is this expected behavior? I am not sure if inline styles in body
are standard compliant, though most browsers seem to support them fine.
You are correct, not compliant but widely supported. See:
http://stackoverflow.com/questions/1303416/does-style-have-to-be-in-the-head-of-an-html-document
Oh, in that case, I can close this issue.
Just one thing; the first answer in SO says HTML5 allows inline style with a scoped attribute. Do you plan to support that? This issue could be then restricted to HTML5 support for <style>
.
Leave the issue open, we may decide to support it at a later date.
Note to self: This should be easy to support in the Jsoup to W3C DOM module, by inserting any extra style elements into the head at this stage.
Test case at: com.github.neoflyingsaucer.test.BackgroundTest.testBackgroundImageWithStyleOutsideHead()