473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

two-column page layout

Hi,
I am trying to set up a simple two column page layout but somehow the
second column shows up at the bottom of the page:
<html>
<head>
<title>Untitled Page</title>
<style type="text/css">
.content{
margin:auto;
width:700px;
background-color:white;
border: solid 1px black;
}
.leftColumn{
float:left;
padding:5px;
width:200px;
border-right:solid 1px black;
height:700px;
}
.rightColumn{
float:left;
padding:5px;
}
.clear{
clear:both;
}
</style>
</head>
<body>
<div class="content">
<div class="leftColumn">
blah blah blah
</div>
<div class="rightColumn">
blah blah blah
</div>
<br class="clear" />
</div>
</body>
</html>

Oct 3 '06 #1
2 1342
Michael Vilain wrote:
Try ... changing the float on the right
column to "right" instead, and giving the right column a width.
...or don't float it at all, but give it a left margin a bit wider than
the width of the left column (e.g. 220px). Though I would opt for
widths and this margin in em units instead.

--
-bts
-Motorcycles defy gravity; cars just suck
Oct 3 '06 #2
On 2006-10-03, as*******@hotmail.com <as*******@hotmail.comwrote:
Hi,
I am trying to set up a simple two column page layout but somehow the
second column shows up at the bottom of the page:
You need to set a width on .rightColumn as well.

I'm assuming you've got more content in it really than "blah blah blah"
(exactly as posted, I get two columns in FF). The computed width for an
auto width float is min("preferred content width", available width).

The "preferred content width" is the width of all the text on a single
line with no line breaks.

I'm simplifying a bit, because the computed width will also not go
shorter than the length of the longest word, but that's not the problem
here.

Anyway, once you've got some text in there, the preferred width quickly
gets above the roughly 500px free to the right of .leftColumn, at which
point the float will no longer at the side and gets moved down.
><html>
<head>
<title>Untitled Page</title>
<style type="text/css">
.content{
margin:auto;
width:700px;
background-color:white;
border: solid 1px black;
}
.leftColumn{
float:left;
padding:5px;
width:200px;
border-right:solid 1px black;
height:700px;
}
.rightColumn{
float:left;
padding:5px;
}
.clear{
clear:both;
}
</style>
</head>
<body>
<div class="content">
<div class="leftColumn">
blah blah blah
</div>
<div class="rightColumn">
blah blah blah
</div>
<br class="clear" />
</div>
</body>
</html>
Oct 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jamey Cribbs | last post by:
At the risk of calling my manhood into question, I humbly submit the following little diddy (which is a blatant rip-off of a heart wrenching melody of the '70s by that international superstar, Mary...
0
by: SimonC | last post by:
I'm looking to do something similar to a feature found on Ticketmaster.com, where you select your seats at a venue, and then you have two minutes in which to take or leave them. QUESTION 1a....
6
by: Willem | last post by:
Hi, I have a newbie question: is it possible to make a search form in asp that searches in two different databases (access)? Willem
10
by: Hank1234 | last post by:
Can I use one Data Adapter and one Command Builder to update amny tables? Currently in my data adapter I query two tables and fill them into two tables in a data set. When I make a change to a...
6
by: Matt K. | last post by:
Hi there, I have a form in an Access project that contains a subform which displays the results of a query of the style "select * from where = #a certain date#". In the main part of the form...
5
by: Jamie Pittman via AccessMonster.com | last post by:
I have two tables with 5000 entries on them. One is based for regular time with several variables example (employee name, date,time in and out, code, customer, building) I have another table that...
7
by: Prabhudhas Peter | last post by:
I have two object instances of a same class... and i assigned values in both object instances (or the values can be taken from databse and assigned to the members of the objects)... Now i want to...
9
by: Steven | last post by:
Hello, I have a question about strcmp(). I have four words, who need to be compared if it were two strings. I tried adding the comparison values like '(strcmp(w1, w2) + strcmp(w3, w4))', where...
9
by: dhable | last post by:
I just started working with Python and ran into an annoyance. Is there a way to avoid having to use the "from xxx import yyy" syntax from files in the same directory? I'm sure it's been asked a...
272
by: Peter Olcott | last post by:
http://groups.google.com/group/comp.lang.c++/msg/a9092f0f6c9bf13a I think that the operator() member function does not work correctly, does anyone else know how to make a template for making two...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.