0

hi i need some help. Suppose i have 4 different xhtml pages(page1,page2,page3,page4), and all the 4 contain one <h1> tag.
Now i have an external css file and it contains(showing only h1 tag):

h1{font-size:16px;font-weight:bold;}

But now i want to add margin-top:10px(only for <h1> tag) for page1,page3 and page 4.if i add it in my css file like this

h1{font-size:16px;font-weight:bold;margin-top:10px;}

page2 also will be changed but i dont want this to happen. Any idea how i can do it?

2
Contributors
1
Reply
14
Views
4 Years
Discussion Span
Last Post by Octet
0

You can use a Class, so it would be <h1 class = "marginClass" > Content </h1> and the CSS would look like:

h1{
    font-size: 16px;
    font-weight: bold;
}

.marginClass{
    margin-top: 10px;
}

You would then add the class section only when you wanted the tag to have the margin (pages 1, 3 and 4).

Edited by Octet

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.