473,417 Members | 1,545 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,417 software developers and data experts.

3 column css without ugly hack?

Hi all

I have a simple 3 column css layout here:
http://www.carfolio.com/newlook.dhtml

However, when the centre column is wider than the screen (yes, it does
happen on some pages on the site and no it can't happen differently) then
the 3rd column overlays itself over the middle column's content. Is there
a css-based 3 column layout without ugly hacks that will give me a 3rd
column as far to the right as need be? Can anyone suggest a fix for the
current design so that this won't happen please?

Thanks a lot for any help/pointers here...

Ciao

Zak

--
================================================== ======================
http://www.carfolio.com/ Searchable database of 10 000+ car specs
Auctioning motoring-related items at eBay? http://www.carfolio.com/ebay/
================================================== ======================
Jul 20 '05 #1
8 3283
CJM
I would take a look at one of the stock layouts from:

http://www.thenoodleincident.com/tut...son/boxes.html
http://glish.com/css/
http://www.inknoise.com/experimental/layoutomatic.php
http://www.bluerobot.com/web/layouts/

I can't remember which one I used, but the result is at
http://www.aif-advocacy.org.uk
(not finished yet, but has 3 columns as required)

I had a real problem coding mine from scratch... some of the finer subtletys
are clearly stilllost on me, so I then decided to plageurise an existing
design... so I would recommend the same to you.

hth

Chris
Jul 20 '05 #2
On Tue, 11 Nov 2003 16:11:11 -0000, "CJM" <cj*****@yahoo.co.uk> wrote:
I would take a look at one of the stock layouts from:

http://www.thenoodleincident.com/tut...son/boxes.html
http://glish.com/css/
http://www.inknoise.com/experimental/layoutomatic.php
http://www.bluerobot.com/web/layouts/

--- snip ---

Chris


Hi Zak.
I also searched for a 3column design and came up with those links
Chris mentioned. But all those designs have the following drawbacks:
- resize your browser to a width of 200-300. See what I mean? Mostly
the rightmost column is overlapped by the middle one.
- resize your browser to >1100. Now the middle column is so big, that
I have problems reading a text with those long lines.

So my solution is inspired by
http://www.wpdfd.com/editorial/wpd0403b.htm
Maybe this is what you were looking for?

Not all of my pages have this design yet, but you can look at:
http://www.hdamm.de/buddha/ahthwtpr.php
Oh - sorry - but they are in German language ;-)

--
Hope this helps.
hd

Jul 20 '05 #3
*Zak McGregor* <za*@mighty.co.za>:

I have a simple 3 column css layout here:
http://www.carfolio.com/newlook.dhtml
You have some broad tables there, thus you really shouldn't want to display
three columns at once, except maybe on extraordinary broad windows. Put the
Feedback part at the bottom, the Quick Search above the Adverts and move the
Advanced Search to a separate page linked from the Quick Search section.
Better yet, put the search into the top navbar. Feedback is linked there
too, so I don't see the need to pollute all pages with the form.

For that reasons I've not even looked into your CSS.
However, when the centre column is wider than the screen (yes, it does
happen on some pages on the site and no it can't happen differently) then
the 3rd column overlays itself over the middle column's content.
It does happen all the time here.
Is there a css-based 3 column layout without ugly hacks that will give
me a 3rd column as far to the right as need be?


<table id="layout"><tr><td>1<td>2<td>3</tr></table>

Your current outline (headings plus divs plus tables) is

div.box
div.header
Carfolio
div.navbar
ul
div.columns
div.leftpane.innerleft
Specifications
Adverts
Newsletter
Advanced search
div.middlepane.innermid
table.comp
div.rightpane.innerright
Quick Search
Feedback
div.clear

I don't know, but maybe div.columns should include div.rightpane.innerright?

Anyhow, it translates into something like

<table id="layout" class="box"><thead>
<tr class="header"><td colspan="3"><h1>Carfolio</h1></td></tr>
<tr class="navbar"><td colspan="3"><ul/></td></tr>
</thead><tbody class="columns"><tr>
<td class="leftpane innerleft">
<div><h3>Specifications</h3></div>
<div><h3>Adverts</h3></div>
<div><h3>Newsletter</h3></div>
<div><h3>Advanced search</h3></div>
</td>
<td class="middlepane innermid">
<table class="comp"/>
</td>
</tbody><tbody>
<td class="rightpane innerright">
<div><h3>Quick Search</h3></div>
<div><h3>Feedback</h3></div>
</td>
</tr></tbody></table>

(about 40 bytes more than with divs, keeping the classes) to which you could
apply

table#layout, table#layout>*, table#layout>*>tr,
table#layout>*>tr>* {display: block}

and then position it with CSS in modern browsers, if you really wanted to.

Btw.: "m²" looks better and is shorter than "m<sup>2</sup>" and torque isn't
measured in nanometres but Newton·metre (N·m) or kg·m²/s². Yes, "²" and "³"
are in Latin-1.

Tip: tbody>tr:hover, tbody>tr:hover>td {background: #F0F0F0}

--
Nothing is lost until you begin to look for it.
Jul 20 '05 #4
On Tue, 11 Nov 2003 20:24:48 +0200, Christoph Paeper <"Christoph Paeper"
<cr***********@gmx.net>> wrote:
Btw.: "m²" looks better and is shorter than "m<sup>2</sup>" and torque
isn't measured in nanometres but Newton·metre (N·m) or kg·m²/s². Yes,
"²" and "³" are in Latin-1.


I guess you can see how those characters show up on my system... I'll
stick to the "uglier" way that at least works on my setup...

Thanks for the Nm spot though, that was bad of me! ;-)

Ciao

Zak

--
================================================== ======================
http://www.carfolio.com/ Searchable database of 10 000+ car specs
Auctioning motoring-related items at eBay? http://www.carfolio.com/ebay/
================================================== ======================
Jul 20 '05 #5
*Zak McGregor* <za*@mighty.co.za>:
On Tue, 11 Nov 2003 20:24:48 +0200, Christoph Paeper
Btw.: "m²" looks better and is shorter than "m<sup>2</sup>"
I guess you can see how those characters show up on my system...


Actually I don't. Maybe your news-reader has a problem with displaying
characters from the upper half of ISO-8859-1, although it's resending it
just fine, but that shouldn't be the case for your browser, except when it's
a rather old one on the Mac
<http://ppewww.ph.gla.ac.uk/~flavell/iso8859/iso8859-mac.html>.
I'll stick to the "uglier" way that at least works on my setup...


"&sup2;", "²", "&#xB2;" and "²" or "&sup3;", "³", "&#xB3;" and "³"
respectively should all work well in browsers. Decimal numeric character
references are traditionally best supported, though.

--
"For every human problem, there is a neat, simple solution;
and it is always wrong." H. L. Mencken
Jul 20 '05 #6
On Wed, 12 Nov 2003 12:27:57 +0200, Christoph Paeper <"Christoph Paeper"
<cr***********@gmx.net>> wrote:
*Zak McGregor* <za*@mighty.co.za>:
On Tue, 11 Nov 2003 20:24:48 +0200, Christoph Paeper
Btw.: "m²" looks better and is shorter than "m<sup>2</sup>"


I guess you can see how those characters show up on my system...


Actually I don't. Maybe your news-reader has a problem with displaying
characters from the upper half of ISO-8859-1, although it's resending it
just fine, but that shouldn't be the case for your browser, except when
it's a rather old one on the Mac
<http://ppewww.ph.gla.ac.uk/~flavell/iso8859/iso8859-mac.html>.


I suspect it has something to do with what fonts are available on my
system. No matter what the browser/newsreader tries to do, if the fontset
doesn't have the requisite character, I don't think it'll display as
expected.
I'll stick to the "uglier" way that at least works on my setup...


"&sup2;", "²", "&#xB2;" and "²" or "&sup3;", "³", "&#xB3;" and
"³" respectively should all work well in browsers. Decimal numeric
character references are traditionally best supported, though.


Again, I think it is a factor of browser support and font availability. I
have the basic X fonts, plus a few that AbiWord installed. As I hate
proportional-width fonts my newsreader is set to use fixed-width fonts.
(clean & fixed in this case.) My browsers (Mozilla & Firebird) have their
own fonts AFAIK and I didn't mess with their defaults.

I also don't think that terminal-based browsers such as lynx would handle
these well (again, also dependent on the specifics of the locale settings
and available fonts I would imagine).

I tried this in lynx and got not-very-nice results:
http://www.obviously.com/browsers/iso-8859-1.html

Ciao

Zak

--
================================================== ======================
http://www.carfolio.com/ Searchable database of 10 000+ car specs
Auctioning motoring-related items at eBay? http://www.carfolio.com/ebay/
================================================== ======================
Jul 20 '05 #7
On Wed, 12 Nov 2003 13:14:53 +0200, Zak McGregor <"Zak McGregor"
<za*@mighty.co.za>> wrote:
I tried this in lynx and got not-very-nice results:
http://www.obviously.com/browsers/iso-8859-1.html


Actually I am incorrect. It displayed them all perfectly as far as I can
see - I was comparing table 1 to table 2 ;-)

Ciao

Zak

--
================================================== ======================
http://www.carfolio.com/ Searchable database of 10 000+ car specs
Auctioning motoring-related items at eBay? http://www.carfolio.com/ebay/
================================================== ======================
Jul 20 '05 #8
On Wed, 12 Nov 2003, Zak McGregor wrote:
I also don't think that terminal-based browsers such as lynx would handle
these well
That's unfair. Lynx's support for character codings, including
Unicode, is excellent.

If Lynx is properly set up, then it can do a fine job.

If it's not working properly, then either the terminal environment
has been wrongly set, or Lynx has not been properly informed of what
it is.
(again, also dependent on the specifics of the locale settings
and available fonts I would imagine).
Oh, sure. No browser can do better than the display situation in
which it finds itself!
I tried this in lynx and got not-very-nice results:
http://www.obviously.com/browsers/iso-8859-1.html


The valid parts of the page work fine for me.

But with a report like this
http://validator.w3.org/check?uri=ht...so-8859-1.html
you need to "beware bogons".

Jul 20 '05 #9

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

Similar topics

6
by: Arvid Andersson | last post by:
Good afternoon, I have some data that looks like this: data = , , ] I want to send columns 1 and 2 to a function as two variables, say "plot(col1,col2)". I can get a row by data, but how...
9
by: flarkblark | last post by:
I recently had the displeasure of looking at the code required to implement the pop-up menus used in a pulldown menu system for a webpage. The sheer amount of Javascript required was amazing...
8
by: kaeli | last post by:
I have had a little free time lately to revisit a problem I have with the 3 column layout plus a header and footer. See this example: http://glish.com/css/7.asp There is a header and 3...
34
by: Steven T. Hatton | last post by:
Pete Vilder mentioned this a few days back. This is the "Compiler-Firewall Idiom", or pimple. It's similar to an approach taken in some Java designs. AAMOF, when I saw it in Java, my first...
9
by: DMAC | last post by:
If i want to split a computed column into two or more columns based on the the length (its a varchar) of the computed column, how often will sql server determine what the computed column is?...
3
by: cr88192 | last post by:
for various reasons, I added an imo ugly hack to my xml parser. basically, I wanted the ability to have binary payload within the xml parse trees. this was partly because I came up with a binary...
10
by: Philipp E. Imhof | last post by:
Hi! I am experiencing a problem with a two-column layout -- apparently I am not the first person, but the solutions I found in GG did not give me what I was looking for. The page should be as...
20
by: benhoyt | last post by:
Hi guys, I've been using Python for some time now, and am very impressed with its lack of red tape and its clean syntax -- both probably due to the BDFL's ability to know when to say "no". ...
3
by: hzgt9b | last post by:
I want a page with a centered div containing two rows. Top row has an image and some text. The bottom row needs to have three columns. I'd love to have the 1st column set to a fixed width then have...
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.