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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.