Is this safe?
* { word-wrap: break-word }
I have too many places where I have to apply this style. Could any evil come from this line? What issues I may have?
First, * is technically not just on the BODY
but also HTML
(yes, sometimes it matters).
Secondly, in isolated cases, using the wildcard can cause performance issues. I have only seen this when using something (admittedly horrible) like DHTML behaviors, but in my opinion it would be better to declare an explicit set of elements to which it applies.
Lastly, it will clutter up all your CSS viewing tools with a potentially unneeded statement.
So, no big problem, but I would suggest just listing the elements that it is actually relevant to, such as P, possibly TD, DIV, etc.
I believe there's no evil in that. Usually I measure the CSS parameters I need and decide wich ones will belong to the document and wich ones are to be treated locally. In your case, if you find that usefull, you just need to ensure that any element that you don't want to behave like that is properly told so.
I apply it just to the body element, like the question suggests:
body { word-wrap: break-word; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With