문제

I have two questions on how to write a correct/without error CSS 2.1 stylesheet:

  1. The CSS validator says to me that overflow-y: scroll is not supported on CSS 2.1. So, what can I use for the same effect?
  2. 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?

Thanks

도움이 되었습니까?

해결책

1. CSS validator say to me that overflow-y: scroll is not supported on CSS 2.1. So, what can I use for the same valid effect?

They're not valid because they were introduced in CSS3. In CSS 2.1, you can only set overflow for both horizontal and vertical at the same time.

Most browsers support overflow-y now, so I would worry less about 2.1 validation (as your CSS will be valid with a CSS 3 validator). You can use overflow: auto as a fallback for unsupported browsers.

2. I have somethings like 500 warning that say Same colors for color and background-color in two contexts .error and .contact3 (about different classes, of course) , what does it means? And how can I resolve this trouble?

The problem is what it says it is. If you have the background-color the same as the color, 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 foreground color to transparent on those elements:

.error {
    color: transparent;
}

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.

다른 팁

You can use overflow:auto; This will add scrollbars when needed.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top