WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > WEB DESIGN > CSS > [SOLVED] Placing 2 DIVs side by side..

Closed Thread
  Thread Tools Display Modes
Old 16th February 09, 02:36 AM   #11
Graphictree
WLC Member
 
Join Date: Feb 2009
Posts: 1
Default Re: Placing 2 DIVs side by side..

Thank you for the explanation. Works perfectly. I've been sitting here for two hours trying to figure it out. Now I learned it in five minutes...Highly appreciated.
Graphictree is offline  
Old 18th February 09, 10:44 AM   #12
lillan
WLC Member
 
lillan's Avatar
 
Join Date: Oct 2006
Location: Sweden
Posts: 13
Default Re: Placing 2 DIVs side by side..

A good idea is to set one of the blocks with an inline style, i.e

Quote:
#leftcolumn { width: 300px; border: 1px solid red; float: left; display:inline;}
#rightcolumn { width: 300px; border: 1px solid red; float: right;}
lillan is offline  
Old 18th February 09, 11:58 PM   #13
avim
WLC Member
 
Join Date: Feb 2008
Location: UK
Posts: 15
Default Re: Placing 2 DIVs side by side..

Thanks for the different solutions, guys. I'm having the same problem but I'll give some of these methods a try now.
avim is offline  
Old 8th April 11, 08:28 AM   #14
andyedberg
WLC Member
 
Join Date: Apr 2011
Posts: 5
Default Re: Placing 2 DIVs side by side..

Thanks for sharing answers. I was searching for this answers from many times and posted this thread in many forums but i was not able to find out the answers.I also want to insert 2 div side by side. One for contains and one for advertisements.
andyedberg is offline  
Old 12th April 11, 09:03 AM   #15
LearningCoder
WLC Lover
 
LearningCoder's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 115
Default Re: Placing 2 DIVs side by side..

I always float my first container left and my second container right (that is, if I want one container completely on the left and one completely the other side on the right). But say if you wanted 3 div's on the same line, I would float the first container left, leave the second container with no floating(just margins to center it) and I usually float the 3rd container to the right.

Or, as lillan said, you can use {display: inline;} to get all your containers inline, then set the margins as you wish. And basically using the clear attribute on an element AFTER you have floated your div's, will effectively put your element (whether it be a <div> or <hr /> etc) on a 'new line' which puts this specific element underneath the floated <div>'s.

Note that if you float an element left, then anything after this element automatically resides next to your floated element, that is, it appears next to your floating element. If you wanted something to float left, but you want your next element to reside underneath this floated element, you have to use the clear attribute on whatever element you would like underneath.
__________________

To view links or images in signatures your post count must be 5 or greater. You currently have 0 posts.

Last edited by LearningCoder; 12th April 11 at 09:07 AM. Reason: Added more
LearningCoder is offline  
Old 15th April 11, 03:17 AM   #16
LearningCoder
WLC Lover
 
LearningCoder's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 115
Default Re: Placing 2 DIVs side by side..

Well, what you need to do it delete all your <table> elements and child elements. (<tr><td>). Then put your content that was inside the table inside a <div>. Then, using CSS, you can position each individual element as you wish.

It would help me if I could see your code, then I might be able to create something for you. Or, if you prefer, do me a Print Screen of your website/table, and I'll try to put something together similar to what you have using tables, but using a div.

If you post your code on here, I'll take a look at it if you wish. Or do me a print screen buddy.

__________________

To view links or images in signatures your post count must be 5 or greater. You currently have 0 posts.
LearningCoder is offline  
Old 16th April 11, 12:52 PM   #17
chrishirst
Banned
 
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,196
Default Re: Placing 2 DIVs side by side..

A: No <body> element. Yes it was optional in such an ancient DTD but browsers do have "issues" without it

B: You are telling browsers to render to HTML 3.2 specifications which was superceded almost FIFTEEN years ago.

CSS1 had only been around a year at that time and you are trying to use CSS2 concepts.

Now even Infernet Exploder with it's penchant for handling "odd standards" is likely to "throw a wobbler" at that.

Come up to a HTML4.01 Transitional DTD at least (Strict if you are feeling brave) and follow the XHTML standard of all tags and attribute names in lowercase.

I would also suggest leaving "Expression Web" sitting on a shelf in a closed cupboard and download Aptana Studio and use that instead.
chrishirst is offline  
Old 17th April 11, 10:43 AM   #18
Jen
WLC Admin
 
Jen's Avatar
 
Join Date: Mar 2006
Posts: 489
Default Re: Placing 2 DIVs side by side..

Any questions regarding divs side by side, please start your own thread.
*locked*

Thanks
Jen is offline  
Closed Thread


Thread Tools
Display Modes
Linear Mode Linear Mode

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Divs in a grid netfuel HTML & XHTML 4 28th June 07 12:05 PM
IE side by side div float akashenk Browser Compatibility 3 14th January 07 01:41 PM
extending multiple divs to fill the screen gucci09 Scripting and Server Side 1 10th January 07 05:54 PM
Strange problem with nested div's in IE emjay1 Browser Compatibility 2 1st September 06 04:28 PM


All times are GMT. The time now is 02:07 PM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyrightę 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.