开发者

How to use the word-wrap property in CSS 2.1 and validate CSS

开发者 https://www.devze.com 2023-03-03 21:10 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号