Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
How to place a div box next to another centered div?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Brackson" data-source="post: 238335" data-attributes="member: 34747"><p>I am trying to add a left and right box to centered container. Here's pretty much what I'm doing. Useless code has been removed (border, lorem ipsum, etc).</p><p>[HTML]<body></p><p> <div id="leftbox"></p><p> <p>Lorem ipsum....</p></p><p> </div></p><p> </p><p> <div id="rightbox"></p><p> <p>Lorem ipsum....</p></p><p> </div></p><p> </p><p> <div id="container"></p><p> <div id="header"></p><p> <img src="images/logo.png"></p><p> </div></p><p> </p><p> <div id="navigation"></p><p> <ul></p><p> <li><a href="/" class="selected">Home</a></li></p><p> <li><a href="/about.html">About</a></li></p><p> <li><a href="/contact.html">Contact Me</a></li></p><p> <li><a href="/portfolio.html">Portfolio</a></li></p><p> <li>&nbsp;</li></p><p> </ul></p><p> </div></p><p> </p><p> <div id="content"></p><p> <h1>Hello!</h1></p><p> <p>Lorem ipsum....</p></p><p> </div></p><p></div>[/HTML]</p><p></p><p>Here's my CSS.</p><p>[CODE]#container {</p><p> width:750px;</p><p> margin: auto;</p><p> border:1px solid black;</p><p>}</p><p></p><p>#leftbox {</p><p> float:left;</p><p> width:200px;</p><p> margin-right:10px;</p><p> padding:10px;</p><p>}</p><p></p><p>#rightbox {</p><p> float:right;</p><p> width:200px;</p><p> margin-left:10px;</p><p> padding:10px;</p><p>}[/CODE]</p><p></p><p>Here's what I'm getting when I run this: <a href="http://i.imgur.com/aY3CGMy.png" target="_blank">here</a></p></blockquote><p></p>
[QUOTE="Brackson, post: 238335, member: 34747"] I am trying to add a left and right box to centered container. Here's pretty much what I'm doing. Useless code has been removed (border, lorem ipsum, etc). [HTML]<body> <div id="leftbox"> <p>Lorem ipsum....</p> </div> <div id="rightbox"> <p>Lorem ipsum....</p> </div> <div id="container"> <div id="header"> <img src="images/logo.png"> </div> <div id="navigation"> <ul> <li><a href="/" class="selected">Home</a></li> <li><a href="/about.html">About</a></li> <li><a href="/contact.html">Contact Me</a></li> <li><a href="/portfolio.html">Portfolio</a></li> <li> </li> </ul> </div> <div id="content"> <h1>Hello!</h1> <p>Lorem ipsum....</p> </div> </div>[/HTML] Here's my CSS. [CODE]#container { width:750px; margin: auto; border:1px solid black; } #leftbox { float:left; width:200px; margin-right:10px; padding:10px; } #rightbox { float:right; width:200px; margin-left:10px; padding:10px; }[/CODE] Here's what I'm getting when I run this: [URL='http://i.imgur.com/aY3CGMy.png']here[/URL] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
How to place a div box next to another centered div?
Top