SunQuest
           CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 31st, 2002, 10:47 AM
chet horchem chet horchem is offline
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: Pekin, IL
Posts: 4 chet horchem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to chet horchem
CSS: Two-Columns

Greetings,

I've been angrily been trying to get a two-column website using css instead of tables. There are many examples out there, but they do not suffice for what I need.
I need the two columns to be static instead of using margins and a float.

#mainbody {
margin:0px 0px 0px 150px;
padding:0px;
}

#leftmenu {
position: static;
align: top;
top:40px;
left:0px;
width:125px;
padding:20px;
background-color:#eee;
border:1px dashed #999;
line-height:auto;
}

This is what I'm working with. The problem is that the "mainbody" appears below the left menu when I need them side by side.

Any Ideas???

Thanks in advance.

Reply With Quote
  #2  
Old August 31st, 2002, 11:31 AM
Tuxie Tuxie is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Inside the GNU/Hurd kernel
Posts: 492 Tuxie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 1 m
Reputation Power: 7
"position: static means that the HTML element is positioned by the natural flow and that this position cannot be changed. I gave the paragraph below a top and left declaration, these should be ignored."

I dont think that Static is what you should be using for Position.

Reply With Quote
  #3  
Old August 31st, 2002, 12:05 PM
chet horchem chet horchem is offline
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: Pekin, IL
Posts: 4 chet horchem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to chet horchem
I omitted "position:static;"

Is there any alternative of "<tr valign="top">" in CSS???

Reply With Quote
  #4  
Old August 31st, 2002, 12:58 PM
adios adios is offline
Senior Citizen
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019 adios User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
<html>
<head>
<title>untitled</title>
<style type="text/css">

#container {
position: relative;
top: 40px;
}

#leftmenu {
position: relative;
width: 125px;
padding: 20px;
background-color: #eee;
border: 1px dashed #999;
line-height: auto;
}

#mainbody {
position: absolute;
top: 0px;
margin: 0px 0px 0px 150px;
padding: 0px;
}

</style>
</head>
<body>
<div id="container">
<div id="leftmenu"></div>
<div id="mainbody">
blah blah blah blah blah blah blah blah blah blah blah<br>
blah blah blah blah blah blah blah blah blah blah blah<br>
blah blah blah blah blah blah blah blah blah blah blah
</div>
</div>
</body>
</html>

Reply With Quote
  #5  
Old September 1st, 2002, 02:51 PM
chet horchem chet horchem is offline
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: Pekin, IL
Posts: 4 chet horchem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to chet horchem
I used your example, but have a few questions:

How could I get the menu to be as high as the mainbody???

How can I place a footer below the container??? I tried just using another div, but it didn't show unless I put it in the container. Then it shows under the menu.

Thank you

Reply With Quote
  #6  
Old September 3rd, 2002, 08:08 PM
adios adios is offline
Senior Citizen
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019 adios User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
Kinda like that old one: how do I get a table column to bottom-justify? Still haven't found a satisfactory answer; I've resorted to scripting instead, on occasion:


<html>
<head>
<title>untitled</title>
<style type="text/css">

#container {
position: relative;
top: 20px;
width: 98%;
}

#leftmenu {
position: relative;
width: 125px;
float: left;
background-color: #eee;
border: 1px dashed #999;
line-height: auto;
}

#mainbody {
position: relative;
float: right;
font: 200 12px arial;
padding: 8px;
background: #d8d8d8;
}

#footer {
width: 100%;
height: 40px;
font: 200 10px arial;
text-indent: 4px;
margin-bottom: 20px;
clear: all;
border: 1px black solid;
background: silver;
}

</style>

<script type="text/javascript" language="javascript">

function redo() {
document.getElementById('leftmenu').style.height =
document.getElementById('mainbody').offsetHeight + 'px';
}

onload = redo;
onresize = redo;

</script>
</head>
<body>
<div id="container">
<div id="leftmenu"></div>
<div id="mainbody">
<script type="text/javascript" language="javascript">
for (var i=0;i<400;i++) document.write('mainbody ');
</script>
</div>
<div id="footer">footer</div>
</div>
</body>
</html>

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS: Two-Columns


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway