7oxic Posted June 19, 2008 Share Posted June 19, 2008 Hey whats up? I'm having some problems and was hoping you guys could help out a new programmer I'm wanting to have 2 different columns of content show up next to each other ( my news articles on the left, and other blocks on right). If you visit this website you will see how I'm trying to do it: http://www.decadora.com/index.html I've tried using different <div> tags, then changing the settings in my style sheet but can't seem to get it to work. The blocks on the right will show up, but will be at the bottom of the blocks on the left side. Please help! Thanks. Link to comment https://forums.phpfreaks.com/topic/111021-block-help/ Share on other sites More sharing options...
haku Posted June 20, 2008 Share Posted June 20, 2008 You can use a structure basically like this: html: <div id="leftdiv">content</div> <div id="rightdiv">content</div> Then set your CSS like this: #leftdiv { width: 100px; float: left; } #rightdiv { padding-left: 100px; } Just make sure that the width of #leftdiv and the paddingof #rightdiv are the same to start with, and you can work from there to add extra padding or whatnot. Link to comment https://forums.phpfreaks.com/topic/111021-block-help/#findComment-569745 Share on other sites More sharing options...
TheFilmGod Posted June 20, 2008 Share Posted June 20, 2008 Let us say you have a parent div called #main: <div id="main"> <div class="left"> <p>Left Stuff</p> </div> <div class="right"> <p>Right Stuff</p> </div> <div class="clear"></div> </div> #main {} #main .left { float: left; width: 200px; } #main .right { float: right; width: 200px; } .clear { clear: both; } ................. There are better ways to clear the divs, but for the sake of simplicity, I put the clearing div in. Link to comment https://forums.phpfreaks.com/topic/111021-block-help/#findComment-570327 Share on other sites More sharing options...
widox Posted June 20, 2008 Share Posted June 20, 2008 I like to start with a functional and tested layout and build off of that. Check out http://blog.html.it/layoutgala/. They have some good basic structures to build from. Link to comment https://forums.phpfreaks.com/topic/111021-block-help/#findComment-570546 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.