Reply
Clearing, Without Unsightly Line Breaks?
Old 05-12-2008, 03:12 PM Clearing, Without Unsightly Line Breaks?
Average Talker

Posts: 28
I am currently working on a site that has content and widgets displayed as a series of boxes. Each box has been designed and styled as a div, and looks/works perfectly. It results in stuff in this format:

Code:
<div class="content">
     <p>this content boxes stuff</p>
</div>
<div class="content">
     <p>different, semi-related content</p>
</div>

On occasion, the last thing in a content box will be floated (think along the lines of a "More" link that is floated right). If this is floated, it tends to jump out of the containing div. My current solution to this problem is a line break that clears the floats. So I'd have <br class="clear"> with the following in my CSS:
Code:
.clear {
    clear: both;
}
This eliminates the problem, but creates a line break where I don't necessarily want one. Does anyone have any simple solutions that I can use to meet both of these requirements?

Thanks,
Cory
Cory Dee is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 05-12-2008, 03:44 PM Re: Clearing, Without Unsightly Line Breaks?
LadynRed's Avatar
Super Moderator

Posts: 6,746
Location: Tennessee
Collapse the line-break space and it won't be noticeable:

.brclear {
clear:both;
height:0;
margin:0;
font-size: 1px;
line-height: 0;

There's also the clearfix:after method:
http://css-discuss.incutio.com/?page=ClearingSpace
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is online now
Reply With Quote
View Public Profile
 
Old 05-13-2008, 08:37 AM Re: Clearing, Without Unsightly Line Breaks?
Average Talker

Posts: 28
Thanks, collapsing the size of the br seems to be working well.
Cory Dee is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Clearing, Without Unsightly Line Breaks?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11549 seconds with 12 queries