This is a discussion on "two divs side by side" within the Web Page Design section. This forum, and the thread "two divs side by side are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
two divs side by side
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
two divs side by side
How do you get two divs to be side by side?
Last Blog Entry: First Post! (Apr 18th, 2008)
|
|
|
|
|||
|
Re: two divs side by side
Here's a very short thumbnail view about DIVs.
DIVs (think of it as a shorter term for DIVision) are the basic building blocks of CSS. By default, a DIV wants to extend 100% of the screen unless a width is specified. DIVs also, by default 'stack' on top of each other. It is possible to 'float' an element to the left or right of another element, and thus you can have two DIVs side-by-side. I might suggest that you read through the CSS section of this forum as well as other online resources such as www.w3schools.com to get a basic overview of CSS. |
|
|||
|
Re: two divs side by side
Here's a simple example
css
|
|
||||
|
Re: two divs side by side
Linda, i think you missed a bit.....!
CSS:
Last edited by Marc; Aug 9th, 2007 at 21:30. |
|
|||
|
Re: two divs side by side
No her code is fine. They'll just float left of each other in much the same way that li's do in a list. Her code is very efficient that's all. That code should work anyway.
Pete. |
|
|||
|
Re: two divs side by side
The question was... how do you put two div's side by side. I didn't place a container or wrapper because technically it's not necessary.
|
|
||||
|
Re: two divs side by side
Oh.. Cool!!! I never knew that you can do that! You learn somthing new every day dont ya? Sorry Linda!
|
|
|||
|
Re: two divs side by side
No linda, Marc thought you needed to float: right; the right hand side div to get it to work but you don't.
Pete. |
|
|||
|
Re: two divs side by side
No problem Marc! It's ok... I make mistakes a lot so it's ok to check my posts!
|
|
|||
|
Re: two divs side by side
That is what I used but it wasn't working so I changed it to have 2 containers: one set to left and one set to right and that worked.
Last Blog Entry: First Post! (Apr 18th, 2008)
|
![]() |
| Tags |
| css, div, html |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how do i put a border only on a certain side | snelll | Web Page Design | 15 | May 28th, 2008 13:30 |
| Side by side positioning | josephman1988 | Web Page Design | 7 | Oct 20th, 2007 12:49 |
| Side Column with CSS | Pádraig | Web Page Design | 2 | Aug 8th, 2007 12:36 |
| pictures side by side | thisandthat | Web Page Design | 3 | May 16th, 2006 00:36 |
| Client-Side VS Server Side Scripting | redev2006 | JavaScript Forum | 1 | Jul 30th, 2005 19:30 |