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

3

5

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.

Lubber answered 5/8, 2010 at 15:53 Comment(3)
When you read the CSS manual page you linked to, did you see the second line which lists all the acceptable values for that property, and note how "suppress" is not listed there?Malleus
@Malleus The page has likely changed in the last 12 yearsLubber
@Malleus In fact, C3W has historic pages and you can see it exists here: w3.org/TR/2005/WD-css3-text-20050627Lubber
P
14

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

Papillary answered 5/8, 2010 at 16:3 Comment(2)
Oddly enough, white-space is a shorthand property for text-wrap.Lubber
This may give you your desired effect and validate, but I believe this is more in line with text-wrap: none; - which has potential to overflow block elements, you'd have to experiment.Papillary
M
0

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?

Marsh answered 5/8, 2010 at 15:58 Comment(4)
The very first thing anyone will tell me before helping me with CSS is "make sure it validates". I'm not 100% sure it will work in all browsers based on my limited testing.Lubber
All things introduced in the CSS3 spec are not implemented across all browsers. This is something you as a developer have to be aware of.Marsh
I realize that but the validator should have it implemented.Lubber
@joe: Yes, and you should file a bug with the W3 CSS validator team: jigsaw.w3.org/css-validator/Email.htmlMarsh
R
0

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/

Romeoromeon answered 5/8, 2010 at 17:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.