Re: margins, ems and context

Le Mer 26 janvier 2011 0:30, Niels Matthijs a écrit :


> [div class="whatever"]
>      [h1]my header[/h1]
>      [p]some paragraphs[/p]
>      [ul]...[/ul]
>      [div class="more"][<a href="#"]read more about whatever[/a][/div]
> [/div]
> for the css, I set my basic layout grid like this:
> ..whatever>* {margin:0.75em 1em;}
> There you have your left and right em margins on the h1 heading. Now if
> you start fiddling with the h1 font-size it will start jumping around,
> which is not very cool, destroying the vertical grid I've just created.


can you try this:

div.whatever {margin: 0.75em 1em;}

div.whatever > * {margin-left: inherit;}

The horizontal alignment should be meeting what I understand from your
description. The h1 element should horizontally start at the same x
position of others.

If you encounter problems, then please consider posting the url of a
reduced demo.

regards, Gérard
CSS 2.1 Test suite RC5 (January 11th 2011)

Contributions to CSS 2.1 test suite

Web authors' contributions to CSS 2.1 test suite

Received on Wednesday, 26 January 2011 14:55:51 UTC