Hmmmm - I'm having trouble dealing with one of those CSS concepts that I
considered as easy as breathing... 

I've got a block-level element (a div) that contains an inline element
(a strong tag, but span would work the same...). When I apply padding to
the internal element, it oversteps the boundaries of its parent element
by the amount of the padding. 

Example:

        div {
                background-color:#FF0066;
        }
        div strong {
                padding: 4px;
                background-color:#003333;
        }


<div><strong>TEXT TEXT</strong></div>




(example posted at http://www.capstrat.com/development/test/test.html)

In this case the strong tag (in all tested browsers except for IE6+)
exceeds the boundaries of the div by 4px. 

I thought the rule was that a container should expand to hold its
contents (excepting floated elements...)

Apparently, I've been wrong all along. Can anyone kick me in the right
direction?

Scott Reston
Director, Web Development
Capstrat
919/882.1966 v
919/834.7959 f
1201 Edwards Mill Road, Suite 102
Raleigh, NC 27607
www.capstrat.com



******************************************************
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
******************************************************

Reply via email to