homepage Welcome to WebmasterWorld Guest from 54.198.42.105
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Making horizontal boxes
steveeshair




msg:4516814
 4:45 pm on Nov 7, 2012 (gmt 0)


System: The following 2 messages were cut out of thread at: http://www.webmasterworld.com/html/4510047.htm [webmasterworld.com] by bill - 3:09 pm on Nov 8, 2012 (jst +9)


I want to have 3 boxes aligned horizontal with css.

Do I have to make a float left and float right box first, and in one of the floats put again a floatleft and float right?

Or,

is it possible to have 3 divs aligned in such way that they are aligned next to each other?

A tip or start is helpful :-)

 

lucy24




msg:4516890
 10:11 pm on Nov 7, 2012 (gmt 0)

Doing it with floats is one way: left, right and default. Another way is to make three divs set to {display: inline-block} with a specified width, and pack all three inside a single bigger block.

The widths have to add up to less than 100% even if you've ruthlessly cut out all margins, padding and borders. Don't ask me why; I just know what doesn't work.

Make sure you think about what will happen if the viewport isn't wide enough to hold all three of your boxes with their content.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved