Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,057 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,576 people online right now. Registration is fast and FREE... Join Now!




Two columns using CSS/HTML...having problems

 
Reply to this topicStart new topic

Two columns using CSS/HTML...having problems

jeffmc21
26 Jul, 2008 - 06:13 PM
Post #1

New D.I.C Head
*

Joined: 27 Nov, 2007
Posts: 47


My Contributions
I hate to even have to ask this, because I've accomplished this numerous times, but I can't seem to get it to work this time.

This is a snippet from a larger page I'm working on, but basically I'm just wanting these two "columns" to be side by side with the text on the left and the sub-menu on the right.

You can see the snippet at www.fortymarketing.net/test1.php.

Thank you guys in advance for your help!!
User is offlineProfile CardPM
+Quote Post

BetaWar
RE: Two Columns Using CSS/HTML...having Problems
26 Jul, 2008 - 08:26 PM
Post #2

#include <soul.h>
Group Icon

Joined: 7 Sep, 2006
Posts: 2,020



Thanked: 81 times
Dream Kudos: 1175
My Contributions
Normally they make you post some code but you posted a link and I checked out the source so we will count it as code posted (sort of).

Here is a basic layout that you can use for what you are talking about.

CODE
<style>
.holder{
  text-align: left;
  width: 740px;
  background: transparent;
  margin: auto;
  border: 1px solid #999;
}
.content{
  width: 580px;
  margin-right: 8px;
  background: #eee;
  float: left;
  padding: 2px;
}
.menu{
  width: 150px;
  background: lightblue;
  float: left;
  padding: 2px;
}
</style>

<center>
  <div class="holder">
    <div class="content">
      The main page content will go here.
    </div>

    <div class="menu">
      Menu stuff here
    </div>
  </div>
</center>


I have heard that the <center> tag has been taken out of standard HTML 1.1 (or something like that) but it will still work (in all browsers the same), just not validate as nicely.

<edit>
Here is a way to get it centered without the <center> tag:

CODE
<style>
body{
  margin: 0px;
  padding: 0px;
  text-align: center;
}
.holder{
  text-align: left;
  width: 740px;
  background: transparent;
  margin: auto;
  border: 1px solid #999;
}
.content{
  width: 580px;
  margin-right: 8px;
  background: #eee;
  float: left;
  padding: 2px;
}
.menu{
  width: 150px;
  background: lightblue;
  float: left;
  padding: 2px;
}
</style>


<div class="holder">
  <div class="content">
    The main page content will go here.
  </div>

  <div class="menu">
    Menu stuff here
  </div>
</div>

</edit>

NOTE - I have only tested these in IE 6.

Hope that helps.

This post has been edited by BetaWar: 26 Jul, 2008 - 08:38 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 06:01PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month