Q: What type of selector is used in this case? p {line-height: 150%;}
Solution: These selectors are called element selectors and are simply used as follows: element-name { /* properties */ }
Q: By applying an ___________ a style can be applied to just a single tag.
Solution: By applying an id rule, a style can be applied to just a single tag. For example, if we name a tag with a unique id attribute as followsAffected Text
Q: The _____________ attribute is used to define the name(s) of the class(es) to which a particular tag belongs.
Solution: Self-explainatory.
Q: What will be the output of below mentioned code snippet? p strong {background-color: yellow;}
Solution: All occurrences of the strong element within a p element have a yellow background.
Q: A similar rule called the ____________ is specified using the plus sign (+) and is used to select elements that would be siblings of each other.
Solution: Self-explainatory.
Q: Which of the following selectors selects any tag with an id attribute set?
Solution: Explanation: Example:#test {color: green;} /* makes a tag with id=’test’ green */
Q: Which of the following selectors selects direct descendents?
Solution: Example: body > p {background-color: yellow;} /* makes all p tags that have the body tag as their immediate parent have the background color yellow */
Q: Which of the following selectors selects siblings?
Solution: p ~ strong {font-style: italic;} /* sets the font style to italic on all strong tags that have a p tag as a preceding sibling */
Q: Which of the following selectors selects adjacent siblings?
Solution: h1 + p {color: red;} /* makes all p tags that are immediately preceded by an h1 tag red */
You Have Score    | /9 |