On Mon, Sep 10, 2007 at 02:50:42PM +0100, Richard Lewis wrote:
On Monday 10 September 2007 14:24:43 Chris G wrote:
On Mon, Sep 10, 2007 at 01:06:32PM +0100, Richard Lewis wrote:
with CSS: .main-text p {margin-top:15px;margin-bottom:15px}
I haven't checked it, though.
No you haven't have you! :-)
Have now.
The above was *exactly* what I thought would work but it doesn't,
Yes it does.
as I explicitly pointed out margin settings are not inherited. Thus although other things set in class "main-text" will be set in those paragraphs the margins won't be. That was why I asked the question.
Not true.
With your code above the <div> block gets the 15px margins and the paragraphs get their previous default.
Not true. The child <p>s are given the margins, /not/ the parent element with class "main-text".
On Mon, Sep 10, 2007 at 12:59:50PM +0100, David Reynolds wrote:
div#content p { /* set your css stuff here */ }
Aha, thanks, that does it. It works for a class as well which is what I really wanted:-
div.content p {/* set your css stuff here */ }
That means exactly the same as the example I gave. The only difference is that David has only selected <p> children of /<div>s/ with class "content".
Well it doesn't for me on Firefox. With the 'p' I get the larger margins I want, if I remove the 'p' I don't get the larger margins.
It's the explicit 'p' that makes it work for paragraphs in the div block.
It can even be reduced to:-
.content p {/* set your css stuff here */ }
for more general use.
Giving /exactly/ what I had.
No, it still has the 'p' which you didn't have.
I'll post my HTML and CSS in a separate message.