Philippe Wittenbergh wrote:
> On Sep 26, 2009, at 11:00 PM, Alan Gresley wrote:
> 
>>> ( I would imagine 'fieldset' in B to be a block level element just
>>> like 'p' in A, and 'span' in both A and B is inline element - but I
>>> don't see why in A it works but in B it doesn't )
>>
>> Hello,
>>
>> You can not give a width to a <span> if it is treated as an inline
>> element. Does this help.
>>
>> .first_label {
>>   display: block; /* Add */
> 
> (written in other words) span, by default, is an inline element [1].  
> 'Width' (and 'height') do not apply to inline elements
> <http://www.w3.org/TR/CSS21/visudet.html#propdef-width>
> If you change the display value of the <span> to block (or inline- 
> block), then 'width' will work.
> 
> The span in your 'A' example is set to 'float:left'. By definition,  
> the 'float' property sets the display value to 'block'.
> <http://www.w3.org/TR/CSS21/visuren.html#dis-pos-flo>
[..]
> Philippe


That is correct Philippe but the original CSS only has this styling for 
  span.first_label.


.first_label {
   width: 230px; /* NOT FUNCTIONING */
   font-weight: bold;
   text-align: right;
   margin-right: 10px;
}


It was not floated so it is behaving as display:inline by default.


-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to