简体   繁体   中英

CSS Validator is saying my usage of text-wrap:suppress is invalid

I am using the W3C CSS Validator and it says that I have an error with the following code:

Property text-wrap doesn't exist : suppress suppress

.fieldLabelRed
{
    padding:0px 2px 0px 2px;
    margin:0px 10px 0px 0px;
    color:#FF0000;
    text-wrap:suppress; <--- This line
}

I have looked at the CSS manual, and this is what I've found, but I don't see anything wrong: Text Wrap Settings: the 'text-wrap' property

I have validated using CSS 2.1 as well as 3.0 and both give the same error.

I'd try white-space:nowrap; instead. I believe that validates correctly, but haven't tried it.

This must be a bug in the CSS validator. However, does it matter whether or not the CSS validates as long as it's working?

Or, try word-wrap: break-word as described in this article from webdesignerwall.com which has come in handy for me several times.

http://www.webdesignerwall.com/tutorials/word-wrap-force-text-to-wrap/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM