2

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.

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?
    – TylerH
    Oct 17, 2022 at 13:42
  • @TylerH The page has likely changed in the last 12 years Oct 17, 2022 at 14:42
  • @TylerH In fact, C3W has historic pages and you can see it exists here: w3.org/TR/2005/WD-css3-text-20050627 Oct 17, 2022 at 16:57

3 Answers 3

12

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

2
  • Oddly enough, white-space is a shorthand property for text-wrap. Aug 5, 2010 at 16:23
  • 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.
    – kmfk
    Aug 5, 2010 at 16:55
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?

4
  • 1
    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. Aug 5, 2010 at 16:04
  • 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.
    – ase
    Aug 5, 2010 at 16:17
  • I realize that but the validator should have it implemented. Aug 5, 2010 at 16:23
  • @joe: Yes, and you should file a bug with the W3 CSS validator team: jigsaw.w3.org/css-validator/Email.html
    – ase
    Aug 5, 2010 at 16:32
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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.