On Monday 10 September 2007 12:51:02 Chris G wrote:
All I want to do is have a set of paragraphs with bigger margins than the default and it looks as if I'll have to do:-
<P class=bigmargin>..............</P>
for every paragraph, which rather defeats the object of using CSS, I might just as well write the margin size there.
If was being markup purist (apart from find the capital 'P' and the missing quote marks from the attribute value worrying) I would say that "bigmargin" is a bit of an odd class. Surely its more semantically pertinent to use values like "error" or "important"?
But, to answer the question, you can probably do something like this:
<div class="main-text"> <p> ... </p> <p> ... </p> </div>
with CSS: .main-text p {margin-top:15px;margin-bottom:15px}
This CSS rule selects all 'p's which are children of an element with the class "main-text".
I haven't checked it, though.
Cheers, Richard