Nesting Selectors
Example
It is possible to apply a style for a selector within a selector.
In the example below, one style is specified for all p elements, one style is specified for all elements with class="marked", and a third style is specified only for p elements within elements with class="marked":
Example
p
{
color:blue;
text-align:center;
}
.marked
{
background-color:red;
}
.marked p
{
color:white;
}
{
color:blue;
text-align:center;
}
.marked
{
background-color:red;
}
.marked p
{
color:white;
}
Other Topics
CSS : All css dimension properties,CSS : Grouping selectors,CSS : Display - block and inline elements,CSS : Hiding an element - display:none or visibility:hidden,CSS : All css dimension properties,CSS : Grouping selectors,CSS : Nesting selectors,CSS : Relative positioning,CSS : Padding properties,CSS : Padding-shorthand property,CSS : Padding - individual sides,CSS : Cross browser compatibality,CSS : Left and right Aligning by float property,CSS : Left &Amp; Right Aligning By Position Property,CSS : The lang pseudo class,CSS : MEDIA,CSS::STYLING FORMS, mechanical Engineering, English books,Photoshop tutorials,Harry potter,Best 100 english books,Mechanical-old-question-paper,
No comments:
Post a Comment