TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-14-2009, 06:38 PM   #1 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default Help with DIV....

Hey guys,

Can someone point me in the right direction for this DIV issue I'm having? Below is what I'd like to do. For the sake of brevity, here's my current DIV structure...

And below it is what I'd like done. Pink area's work fine, it's the orange area where I can't seem to get a new DIV to show up...I'd like to have a box that's about 32px in height and 400px in width...

PHP Code:
<div id="container">
    <
div style="float:left"></div>
    <
div style="float:right"></div>
    <
div style="float:right"></div>
</
div




Just to add:

If I were to do this in tables. I would have 2 rows, 2 columns. Then the left column would have a ROWSPAN of 2, so it would be a big box. Then on the right side, I would have 2 separate table rows to do as I please...

So I'm trying to do the same thing via DIV's...
allworknoplay is offline  
Reply With Quote
Old 05-14-2009, 08:25 PM   #2 (permalink)
The Addict
 
CoryMathews's Avatar
 
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
CoryMathews is on a distinguished road
Default

put an extra div in there right after the two float rights with the style="clear:right" that should do the trick
CoryMathews is offline  
Reply With Quote
Old 05-14-2009, 08:36 PM   #3 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by CoryMathews View Post
put an extra div in there right after the two float rights with the style="clear:right" that should do the trick
That sure did it! Thanks...

Now I'll have to look into what "clear" means, but it works!
allworknoplay is offline  
Reply With Quote
Old 05-15-2009, 04:51 AM   #4 (permalink)
WebDev'n Beer Drnkn' Fool
 
stewart's Avatar
 
Join Date: Dec 2007
Location: Denver, CO
Posts: 59
Thanks: 2
stewart is on a distinguished road
Default

Clearing "clears" floats.

Like in your example, clearing on the right side told the browser to not allow any floated elements on the right side of the element.

You don't need to (and probably shouldn't..) put an extra div in there to achieve this either, you can just add the clear:right to your div that you want to clear the others.

And just for reference, clear: both , would make it drop down below all of the floated elements.
__________________
stewart::howe
Web Developer & Programmer
CelerMedia.Com | iAmStewart.com | CelerLabs.com
Send a message via ICQ to stewart Send a message via AIM to stewart Send a message via MSN to stewart Send a message via Yahoo to stewart
stewart is offline  
Reply With Quote
Old 05-15-2009, 11:34 AM   #5 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by stewart View Post
Clearing "clears" floats.

Like in your example, clearing on the right side told the browser to not allow any floated elements on the right side of the element.

You don't need to (and probably shouldn't..) put an extra div in there to achieve this either, you can just add the clear:right to your div that you want to clear the others.

And just for reference, clear: both , would make it drop down below all of the floated elements.

Thanks for the "clear" explanation! Get it? Clear?
allworknoplay is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 05:10 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design