I want to validate my CSS. When I enter my website url in http://jigsaw.w3.org, I see this message: Property word-wrap doesn't exist : break-word break-word. How do I use wo开发者_如何学Crd wrap code in my validated CSS, or how to wrap words in CSS 2.1?
word-wrap
is CSS3 so there is no way to make it work in a CSS2 validator.
I don't know of a workaround in CSS2. You may have to either live with invalid CSS in this case, or put all the invalid rules into a separate style sheet:
styles.css
.text { font-size: 12px; color: red; ..... }
invalid.css
.text { word-wrap: break-word }
that way, the main style sheet will validate, which is good if you are using it for quality control.
精彩评论