Previous Message
Next Message

Background property inherits backwards?

Sent by Philippe Wittenbergh on 16 September 2005 02:02

On 16 Sep 2005, at 2:09 am, rhett crowe wrote:

> Hey Everybody,
> I have a page with 2 floated columns created with divs, in a container 
> div, nested in another main div. When I close the container div and 
> then put an <h4>, the background properties of the <h4> show up in the 
> columns in the div above. (The bullet list should not have any 
> background properties at all). I can't seem to find the answer, I 
> think partly because I don't know what to call the problem :o)
> Page:
> CSS: <h4> is in head of page, rest is 

As Rob mentioned, you can't use an ID multiple times. use a class 
instead. But that won't fix your problem.

What you see on your page is correct, although possibly unexpected. You 
float a box, and then the next element (an h4) is not floated. The 
floated box is taken out of the flow. The *text* in the h4 box is 
pushed down by the floated box, but the h4 box is;  the h4 box is 
extended vertically to allow for this.

A simple test file maybe illustrates this better:
the first 'subtitle' matches your styling, as does the box preceding it 
(floated, with a red left border).
The second 'subtitle' has one additional style rule: {clear:left;}. 
This forces the h4 box to move completely under the floated box (red 

Philippe Wittenbergh

css-discuss [EMAIL-REMOVED]]
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread: