Semantic code and header tags within DotNetNuke skins
We can take this one step further and specify a class for a header tag.
The second line of text uses the following code:
<h1 class="article">Text using a H1 Tag with article class specified</h1>
Add this code to the skin.css file
h1
{
color: Purple
}
.Normal h1
{
color: red;
}
h1.article
{
color: blue;
}
You will see that any header tags that specify the “article” class are now colored in blue.
Note the order of the CSS code has to be in the order specified above, if you use:
h1
{
color: Purple
}
h1.article
{
color: blue;
}
.Normal h1
{
color: red;
}
All text will be displayed in red because the .Normal h1 class overrides the h1.article class. | |
|
|