Jump to content
Stef's Coding Community
Sign in to follow this  
Andrea

How would I 'unfloat' something?

Recommended Posts

Inside a wrapper, I have a left-float and a right-float division.

#left {float: left;}

#right {float: right;}

On one of the pages, I don't have the left div, and want the right div to take over the entire wrapper width - so if I were to use
in my HTML, what do I need to add to my CSS to make it so?
#left {float: left;}

#right {float: right;}

#right.entire {???;}

 

I bypassed the problem by just changing the div id on that page to a new name - but surely, there is a better way.... I imagine it's so easy, I'll feel stupid for having asked :o

Share this post


Link to post
Share on other sites

#right.entire {float: right; width: 100%;}

 

and possibly a clear: both; in a following div.

 

Another option: Since it is now the only div, you probably don't need the float; so delete the #left div and create

 

#right.entire {width: 100%; float: none;}

 

And/Or leave the left div there in case you need it later;

#left.none {float: left; width: 0; display: none;}

Edited by Wickham

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...