Click to See Complete Forum and Search --> : P Margin not being recognised


riz-man
03-07-2009, 06:58 AM
I have a div that has the p margin set for it....like so...

#col2 {
float:left;
width:80%;
position:relative;
left:50%;
overflow:hidden;

}
#col2 p {
margin:10px;
}

All paragraphs in this div will have a margin of 10 pixels.

However, I also have a table within this div. The paragraphs in this table need to have different margin settings. So I set up a class for the table in question...

.table {
display:table;
border:1px solid blue;
margin:auto;
}

.table p {
margin:3px;
}

Unfortunately the col2 p is overruling table p...so the paragraphs inside the table are giving me margins of 10 pixels. Is it possible to set a different p value for the information in the table?

Thanks

Riz

Fang
03-07-2009, 07:13 AM
#col2 .table p {
margin:3px;
}

riz-man
03-07-2009, 07:27 AM
Fang...as always...you're the man!

Fang
03-07-2009, 07:37 AM
CSS specificity: http://www.molly.com/2005/10/06/css2-and-css21-specificity-clarified/