Previous Message
Next Message

:hover span + font-size glitch

Sent by Steve Clay on 14 March 2005 13:01


Monday, March 14, 2005, 5:00:32 AM, Lukasz Grabun wrote:
LG>   h2 { margin:1em 0 0; padding:0; line-height: 2em; }
LG>   h2 span { display: none; }
LG>   h2:hover span { display: inline; font-style: italic; font-size: 70%;
LG> padding: 0; margin:0 0 0 1em; }

LG> and corresponding HTML code:
LG> <h2 id="chapter1">Chapter 1<span>#chapter1</span></h2>

LG> When no font-size property is applied to h2:hover span selector there
LG> is no "jumping" effect when one hovers on h2. However, once applied,
LG> [h2 grows in height]

You can fix it by applying a line-height to the SPAN as well.  As to why
this happens?  I've no idea.  SPAN should naturally inherit the line-height
of the H2 (2), yet the jumping occurs unless you manually set it.

The inline box model continues to confound.  Anyone want to clarify?

Steve
-- 
http://mrclay.org/ : http://frenchhorns.mrclay.org/

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: