Previous Message
Next Message

alignment problems

Sent by Gunlaug_Sørtun on 1 March 2006 13:01


Fu Ni T'hat wrote:
> Stuart King wrote:

>> http://www.skingdesign.com/wendi_site/index.htm

> Someone else can explain why ... I don't quite understand it myself. 
> But if you use: <p class="pEM">
> 
> instead of: <p><span class="pEm">
> 
> it will work. Same is true of other class.
> 
> Funny, that.

Yes, but quite logical... :-)

The solution given above is fine, and seems to work as intended. The
divs that are used in that page now might not be the most
logical/semantical element to use for text, but that's another matter.

The reason is that a span is an inline-element by default, while a p is
a block-element. A div is also a block-element, and some of those '.pEM'
styles only apply to block-elements and will be ignored on inline-elements.
This means that if a span has the style 'display: block' set on it, the
other styles are supposed to work on that element too - regardless of
its default. Might be needed at times, but not here.

CSS is fun - most of the time ;-)

regards
	Georg
-- 
http://www.gunlaug.no
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Possibly related: