Jump to content

How to fit backround around two floating divs?


entropy

Recommended Posts

Hello. I am trying to get a background fit around two floating divs:

<html><head><style type="text/css">body {width: 800px;}.toptitle {background-color: #FF0000;margin: 0;padding: 1em 1em;}.logo {float: left;}.search {float: right;}</style></head><body><div class="toptitle">  <div class="logo">   <img src="image.gif" width="200px" height="65px">  </div>  <div class="search">   Search:  </div></div></body></html>

The background shrinks to the top of the divs, while I want it to neatly fit around them. I can't give it a fixed height, because the size of the image is beforehand unknown.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...