• 0

[SOLVED] CSS: Div height not accounting for image?


Question

Hi guys,

So here's the issue: I have a normal div with the following style:

	#information {
		width:900px;
		background: url(images/infobg.png) repeat-y;
		border-top:1px solid #000000;
		border-bottom: 1px solid #000000;
		color:#FFFFFF;
		font-family: "Verdana", "Arial";
		font-size:12px;
		padding:20px;
		line-height:18px;
	}

and the following html code:

    <div id="information">
      <p><img src="style/images/logo.png" height="119" alt="Century 21 Pro-Team" align="left" />Why isn't this working?!?!</p>
  </div>

the problem is, the background of the div isn't extending down past the image, where it should be, so it looks like this:

804785122.png

any suggestions?

thanks in advance :)

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I believe its because you are floating the image (although using the inline align tag). You will need to clear the float, try adding <div style="clear:both;"></div> after your paragraph tag and see how that works. Im sure theres a more elegant way of solving that, I'm not sure if that will work with the align= tag or if it functions the same way as just floating the image left or right.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.