Div inheritance

Soldato
Joined
6 Jun 2011
Posts
2,741
Hey guys,

I am creating a second page on my website. However I have created a second div because I want the content on the second page to have a different margin.

Is there any better way of doing this? Maybe inheriting the div style somehow and just changing the margin?

This is what I have:

http://jsfiddle.net/Yrx3F/

Thanks :)
 
Thanks for the response again. If I change it to what you have just said it does not work in the same way now.

Any ideas?

Thanks :)

EDIT: It works like this for some reason:

<div class= "reviewcontent" id="subPageContent">
 
Last edited:
Hi there, I have that but the only way I can overwrite the margin-top is to use an ID for it.

Like this:

<div class= "reviewcontent" id="subPageContent">

However I have no idea if this is ok?

Thanks :)
 
Thanks guys, one other thing.

This bit of code for example:

<div class="latest">Latest review:</div>

Is it better to use a div to style it? Like this:

.latest{
font-family: arial;
font-size: 75%;
margin-top:40px;
}


Or should I use say this:

<p class="latest">Latest review:</p>

And then style like this:

p.latest{
font-family: arial;
font-size: 75%;
margin-top:40px;
}


I am not sure if I am using to many divs too style particular things.

Thanks :)
 
The only problem is when it comes to screen readers etc. So this is part of my page:

http://puu.sh/9fmr

Xbox 360 is h1, but latest would not be h2 because of its size and would probably be h3. Elder scrolls title would be h2.

Does this matter that they do not go in order?

Thanks again folks.
 
Right ok thanks, so DIVs are more for layout then I assume? If there are tags already used such as p and img then these can be given a class or id without the need for a div?
 
Back
Top Bottom