Jump to content

Block Help!


7oxic

Recommended Posts

Hey whats up? I'm having some problems and was hoping you guys could help out a new programmer ;D

 

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.