Web Design Forum: css bg - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

css bg

#1 User is offline   mteam 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,828
  • Joined: 07-November 09
  • Reputation: 247
  • Gender:Male
  • Location:Manchester
  • Experience:Nothing
  • Area of Expertise:Nothing

Posted 07 January 2010 - 01:48 AM

I cant work out whats happening here

Theres supposed to a bg color behind the text I loose it went I float my text ??

tia Jack

<div id="content2top"><!--roundedcornertop--></div>
 
<div id="content2"><!--this one has the bg colour-->
 
<div class="leftsc"><!--left text-->
</div>
 
<div class="rightsc"><!--right text-->
</div>
 
</div>
<div id="content2bottom"><!--roundedcornerbottom--></div>

0

#2 User is offline   Wickham 

  • Web Guru
  • View gallery
  • Group: Moderators
  • Posts: 2,875
  • Joined: 11-June 09
  • Reputation: 257
  • Gender:Male
  • Location:Salisbury UK
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 07 January 2010 - 07:15 AM

Add this style:-
.clear { clear: both; width: 100%; height: 0; visibility: hidden; }


and add the clear div into the markup before the closing tag of the #content2 container:-
...........be.</p>
</div>

<div class="clear">& nbsp;</div><!--added clear div (no space between & and nbsp;-->

</div>
<div id="content2bottom"></div>

</div><!--end middle-->


The floated divs have no height, so the #content2 container doesn't know where to add the background. Adding an unfloated invisible div with no height after the floated divs makes the #content2 take the background down to it.

Edit: your #content2bottom div which has no content should do the same thing if you move it above the </div> tag into the #content2 div.
1

#3 User is offline   mteam 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,828
  • Joined: 07-November 09
  • Reputation: 247
  • Gender:Male
  • Location:Manchester
  • Experience:Nothing
  • Area of Expertise:Nothing

Posted 07 January 2010 - 08:08 AM

thanks Wickham much appreciated

also that reminded me to put &nbsp; into the 2 empty divs

I'm getting there slowly lol
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users