Reputation: 186003
<style>/* foo */ body{color:red}div{color:green}</style>
So, I have this <style>
element. It has a comment, and then several CSS rules. It is my CSS reset code, so I would like to have it in one line, without a single line break inside the <style>
element.
Is this OK with browsers?
Upvotes: 2
Views: 198
Reputation: 724252
Sure it is. Whitespace is insignificant in CSS except in at-rules, as the descendant combinator, and when using it to separate property values (e.g. in shorthand properties), among other things.
The CSS2.1 syntax documentation talks about the effect of whitespace (or lack thereof) on your CSS code.
Upvotes: 2
Reputation: 303411
Yes (provided you include proper attributes on your <style>
element :).
Upvotes: 0