Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

3 Colums - Background Image Issue

Featured Replies

Hello!

 

I am coding a simple site for a mate(not my design!) and he has 3 columns in the main content area.

 

I have a #content (container) div, with the 3 columns all floated left inside it.

 

But when I do this, the repeating background image dissapears - can anyone tell my why this is?

 

<div id="content">
	<div id="left">
	<p>Hello......text</p>
	</div>

	<div id="middle">
		<ul id="menu">
			<li class="home"><a href="index.html">Home</a></li>
			<li class="about"><a href="about.html">About</a></li>
			<li class="packages"><a href="packages.html">packages</a></li>
			<li class="portfolio"><a href="portfolio.html">Portfolio</a></li>
			<li class="quote"><a href="quote.html">Get A Quote</a></li>
			<li class="contact"><a href="contact.html">Contact</a></li>
		</ul>

	</div>
	<div id="right">
		<img alt="" src="img/test-pic.jpg" />
	</div>
</div>

 

#content {
position:relative;
left:53px;
width:807px;
/*min-height:400px;*/
}

#left {
float:left;
width:291px;
padding:0 5px;
text-align:justify;
}

#middle {
float:left;
width:205px;
}

#menu ul, #middle ul, .social ul {
	list-style-type:none;
	padding:0;
	margin:0;
}

#menu ul li {
	display:block;
}
/* menu css goes on for a bit so i removed it here for your viewing...*/		

#right {
float:left;
width:291px;
}

 

Thanks

I'm guessing that the background image is applied to a div that encloses the columns, as there is no background image in the code you've placed above.

 

I think it is probably due to the floats not being cleared before the Content div closes.

 

Put this in your CSS:

.clear {
   float: none;
   clear: both;
}

 

& immediately before the content div closes, put this:

<div class="clear"></div>

  • Author

I'm guessing that the background image is applied to a div that encloses the columns, as there is no background image in the code you've placed above.

 

I think it is probably due to the floats not being cleared before the Content div closes.

 

Put this in your CSS:

.clear {
   float: none;
   clear: both;
}

 

& immediately before the content div closes, put this:

<div class="clear"></div>

 

Thanks!

Tried the clear:both thing but didn't try it your way!

 

Thanks

 

plus 1'd you :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.