문제

There are six different types of selectors in CSS style rules: type selectors, universal selectors, ID selectors, class selectors, pseudo-class selectors, and descendant selectors. Identify and name the four different selectors used in the following style rules.

#a1, .important { font-style:italic } 
ol span { background-color:aqua } 
a:hover { color:green } 

I used this site for information. http://www.w3.org/TR/CSS21/selector.html#simple-selector

The only one i can guess is that #a1 is a universal selector?

Could someone please explain this to me? Or could you find me a website that does, i didn't find any sites useful and w3 isn't helping me either

도움이 되었습니까?

해결책

W3 documentation is very verbose and difficult for a beginner, to interpret

try this: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started

specifically, to answer your question:

https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors

다른 팁

The first one is ID selector PLUS class selector for ID "a1" and class ".important". The second is descendant selector for all spans that are children of ol. The third is universal selector for all anchor tags on hover state.

#a1  - ID selector 
.important    - class selector
ol span  -  universal selector
a:hover - pseudo

Try this site for learning. It is very good for beginners.

http://www.codecademy.com/tracks/web

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