You are floating the first to the right, which makes it only as wide as it has to be. A float is an element that only takes up as much space as it needs The second is a typical block level element, so it takes up the entire space it's allotted.

-Estelle
http://www.estelleweyl.com

----- Original Message ----- From: "Mark Kamian" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, October 04, 2005 3:55 PM
Subject: [css-d] why are these two <h2>s different?


Hi list,

Having fun learning css, but this is getting me. As seen in the markup below, I'm using <h2> in two instances. In the first instance, along with the text comes what appears to be a line-break before and another one after. However, in the 2nd instance, the before and after spaces aren't there. Is there an explanation for this?

Also, in Win/IE, it's more like 2 spaces after the text, instead of one before and one after. Is this discrepancy normal?

Thanks for any assistance.


STYLE (relevant)/
H2
{
   font-size: 100%;
   color: #c59696;
   letter-spacing: 1px;
   background: gray;
}
#subheader
{
   float: right;
   margin-top: 15px;
   margin-right: 10px;
   text-align: right;
   background: blue;
   border: #f00 1px solid;
}

MARKUP/
http://d557386.u42.hostserv-dns.net/index2.asp
...
<div id="subheader">
 <h2>Sales&nbsp;&nbsp;Leasing&nbsp;&nbsp;Development</h2>
</div>
<div id="main-body">
 <div id="content">
   <h2>Welcome to Ellison Commercial!</h2>
 </div>
...
</div>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
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/


______________________________________________________________________
css-discuss [EMAIL PROTECTED]
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/

Reply via email to