Rahul Gonsalves wrote:

http://rahulgonsalves.com/v2/index.html

The only small, niggling thing left is that whenever there is a paragraph preceded by a h2, it seems to be adjusted, only by a pixel or two, to the right. Any ideas as to how I could fix this? It's a small thing, but since the design hangs on a grid, a little misalignment looks pretty nasty.

I agree... :-) ...and I should have fixed it the first time around
without mentioning it. Now I have to add a longish explanation.


It's 3px offset in IE6 (and older), and that's why it's called the '3px
jog' bug.

The most stable fix is to "remove" the floating h2 at the left of the
paragraph, so IE/win doesn't add interaction between those two elements
into its buggy calculations.
No interaction = no '3px jog' bug.

"Removing" a float can be done by pulling in one or both of its backside
margins, so the float no longer takes up space in front of another element.
Method described here...

<http://www.gunlaug.no/contents/wd_demo_float_03.html>

...but since other elements should still interact with the headline in
your page, a smaller and more precise negative backside margin value is
necessary. The idea is to "partly remove" the float from the flow.


A working fix is to put a suitable negative margin-bottom on the
floating headline to...

#content h2 { margin: -.33em 0 -1.1em 125px;}

...and the headline is "partly gone" and does no longer take up space in
front of the paragraph. It's still perfectly aligned and visible though.

There's no need to hack in this IE-fix, since it's perfectly valid and
all browsers will handle negative backside margins the same way - giving
you a cross-browser reliable line-up.
You may however want to add a bit more 'margin-top' on elements
following directly below such a "partly removed" float, as they will end
up 1.1em higher than before.

Hope the above makes sense.


(I wonder if this qualifies as a "rotten" fix using "standards", and if
so if it makes me a "rotten standardista" (or "something") :-P )

regards
        Georg
--
http://www.gunlaug.no


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to