Home

Forums

Web development

 

 

 

 
     
 
dna88 Web development and Technology Forum
 
Profile   Register   Memberlist   Usergroups   FAQ   Search  Log in
Tutorial on Clear Space with CSS

 
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum
Author Message
emm
Power User
Power User


Joined: 13 Jul 2004
Posts: 310

Post Post subject: Tutorial on Clear Space with CSS Reply with quote

This is a very useful CSS trick that I learned recently. Thought some of you might need it someday as we all know how valuable the clear spaces are sometimes in web page layouts.

Clear Space Option 1

<div class="spacer"> </div>
div.spacer{
clear: both;
}

This should work, and as DIV has no intrinsic height you can style it to
have as much or as little vertical space as you like. But,
IE5 and IE6 have several nasty bugs that can appear when a DIV is used
to clear floats. They appear only if various conditions are met, so
they may or may not occur on your page.

Clear Space Option 2

br{
clear: both;
}

This is safe and reliable, but BR also carries some default
behaviour of a certain amount of vertical space that you cannot alter.

You can always create classes of BR's, and each could behave differently.

From thread: "Clearing space beneath floated elements," April 2002.

Clear Space Option 3
hr.clearing {
display: block;
clear: both;
visibility: hidden;
height: 0;
border-width: 0;
margin: 0;
padding: 0;
}

This method reduceds the vertical space to a minimum.

Long live CSS
_________________
“You might say reality is the result of complex negotiations between the observer and the observed. But that is simply a point of view…”
Digital Bangladesh
Tue Jul 20, 04 12:28 pm
Back to top
emm View user's profile Send private message
quantum
Site Admin
Site Admin


Joined: 07 Mar 2004
Posts: 1048
Location: Dhaka, Bangladesh

Post Post subject: Reply with quote

Thanks emm for the valuable tip. Gentle smile
_________________

Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
Wed Jul 21, 04 9:28 am
Back to top
quantum View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum All times are GMT - 7 Hours
Page 1 of 1

 

Partners and Resources

Bangladesh hosting company

Bangladesh web design

Driven by phpBB © phpBB Group