I have two questions on how to write a correct/without error CSS 2.1 stylesheet:
- The CSS validator says to me that
overflow-y: scrollis not supported on CSS 2.1. So, what can I use for the same effect? - I have something like 500 warnings that say Same colors for color and background-color in two contexts .error and .contact3 (about different classes, of course), what does it mean? And how can I resolve this?
They’re not valid because they were introduced in CSS3. In CSS 2.1, you can only set
overflowfor both horizontal and vertical at the same time.Most browsers support
overflow-ynow, so I would worry less about 2.1 validation (as your CSS will be valid with a CSS 3 validator). You can useoverflow: autoas a fallback for unsupported browsers.The problem is what it says it is. If you have the
background-colorthe same as thecolor, it generates a warning because any text will not be visible to the user. If that is your intention, you would be better off setting the foregroundcolortotransparenton those elements:Beyond that, though, warnings are just warnings and your CSS is valid with them. Warnings exist to let you know that you may have made a mistake.