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):


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


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

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

    font-size: 16px;
    font-weight: bold;

    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).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.