|
|
|
It is possible to make selectors that will only work in certain contexts.
For example, you can define a style for the <B> tag that is only triggered if the text is not only bold but also written in italics.
For example, the style should be in effect here:
but not here :
THE SYNTAX
Simply adding a normal style to the <B> tag is done like this:
Adding a context dependent style, like the one described above is done like this:
We simply separated the contextual <I> tag from the <B> tag with a space.
USING GROUPED AND CONTEXT DEPENDENT SELECTORS AT THE SAME TIME:
It is possible to use context dependent and grouped selectors at the same time.
For example, like this:
I B, .headlines, B .sublines {font-size:16px;}
|
|
In the example the font-size of 16 pixels is in effect on:
1) All <B> tags enclosed by <I> tags
2) All headlines classes.
3) sublines classes enclosed by <B> tags.
|
|
|
|