473,569 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Kapok" method: 3-col liquid

Here's a (new?) variation on using negative margins to get a three-
column layout - I've used the example HTML from A List Apart's article
by Alan Pearce:

http://alistapart.com/articles/multicolumnlayouts

for comparison's sake, but note the CSS layout method is quite
different, using padding on an "inner wrapper" div within the center,
rather than borders.
Three questions:

Do you see a problem with using this method as the basis for a fully
fleshed-out three-column layout?

Have you seen it used as such before, and if so, can you point to
further examples or information on the technique? (side note, if not, I
christen it the "Kapok" method since it uses padding <g>)

and (especially if your answers to the above two are no)

Can you point to "tried and true" three-column layout techniques robust
enough for a CMS-driven site where users are contributing unpredictable
content that may disrupt a fragile layout?
I've set the code up in three stages like a howto, so that newbies can
easily see the logic behind it.

Stage 1:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>3 columns, liquid center</title>
<style type="text/css">
body{
margin:0;
padding:0;
}
#container{
background-color:#0ff;
float:left;
width:100%;
display:inline; /* So IE plays nice */
}
#leftRail{
background-color:gray;
float:left;
width:150px;
position:relati ve;
height:300px;
}
#center{
background-color:yellow;
float:left;
width:100%;
height:300px;
}
#rightRail{
background-color:green;
float:right;
width:200px;
position:relati ve;
height:300px;
}
</style>
</head>
<body>
<div id="container" >
<div id="center">
<div id="articles">C enter Column Content</div>
</div>
<div id="leftRail">L eft<br /Rail</div>
<div id="rightRail"> Right Rail</div>
</div>
</body>
</html>
Stage 2:

add:

#articles{
padding:0 200px 0 150px;
}
Stage 3:

add:

margin-right:-100%;

to the ruleset for the #center div
Here's my explanation for how the negative margin works, please let me
know if I'm off base:

By setting a negative margin equal to the width, the float rules act as
if this div has no width at all, allowing the following floated boxes to
overlap it.
Thanks for your time and attention, and hope someone finds this helpful,
or at least interesting. . .
Jul 8 '08 #1
1 2014

hansBKK wrote:
Here's a (new?) variation on using negative margins to get a three-
column layout - I've used the example HTML from A List Apart's article
by Alan Pearce:

http://alistapart.com/articles/multicolumnlayouts
Not new at all. The Ruthsarian layouts have been around for years and
use the same principles.
http://webhost.bridgew.edu/etribou/layouts/

It doesn't really matter much if you use margins, borders or padding to
get the 3-column result, it's all the same idea. Margins are good for %
widths, since borders can't be set in %.
I've set the code up in three stages
Don't post code, post a URL.

--
Berg
Jul 8 '08 #2

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

Similar topics

2
1700
by: kayodeok | last post by:
Found during my web travels: Liquid Layouts: The Easy Way http://www.maxdesign.com.au/presentation/liquid/ Posted here for you to pick apart ;) -- Kayode Okeyode http://www.kayodeok.co.uk/weblog/
0
2162
by: Chad | last post by:
I have a horizontal navbar between my banner and the page's main content (divided into three columns). Below the navbar, the left and right columns are fixed and the center is liquid. I want to position the navbar "li"s directly above the center column and make them liquid so they stretch and contract in correspondence with the center...
8
2050
by: oj | last post by:
Please, bare with me. I'm new to CSS and would like to ask for some advice on my current project. I have an existing table based layout that serves as the main template for a .Net application I've been working with. I would like to convert this layout to css based liquid design. I would like the pages to stretch both horizontally and...
1
2276
by: Durabo | last post by:
Hi, i must divide the page of my situated Internet in 3 lines and would want to make in way to have a layout liquid (would have to be adapted therefore to whichever dimension of the window). Initially I have divided in two parts as it follows:
248
10293
by: Generic Usenet Account | last post by:
As per Google's Usenet archives http://groups.google.com/googlegroups/archive_announce_20.html], the first discussion of the Y2K problem on the Usenet was on January 18 1985 http://groups.google.com/groups?threadm=820%40reed.UUCP]. That is a good 15 years before the problem manifested. Even then, it turned out, we were scrambling for cover...
5
1499
michaelea
by: michaelea | last post by:
Hi, new newbie here..to liquid styles anyways... I'm not quite sure how to state my question properly but I'm hoping someone can help me please. How do I place a liquid Div inside a liquid container or, to put it another way: http://www.northcoastcomputerservices.com/liquid.htm is the page I need to edit - liquid.css is my style sheet....
4
2795
by: ge5talt | last post by:
Longtime reader, 1st time poster :) I am in the process of overhauling a website and replacing an old table-based quirksmode layout with a standards-mode tableless one. I am currently working on pop-up webpages which used to be liquid and proportionally resizable (including input fields on them), something I have found to be tough to reproduce...
9
8135
by: Eric Lindsay | last post by:
How do you provide a consistent gradient fill as a background in a liquid layout? If I make a gradient fill image say 1000 pixels wide (and repeat it down the page) to suit a typical computer display, then only a small portion of the gradient will show if the viewpoint is a smaller PDA or phone display. On the other hand, if viewed full...
0
1813
by: announcements | last post by:
Liquid Technologies Announces Availability of Liquid XML 2008 (v6.1) New features include: - New Code Generation for C# and VB .Net (2005 and 2008) utilizing Attributed classes with Generic Collections for a massive reduction in the number of generated classes. - New C# and VB .Net Runtimes for .Net 2.0 and .Net 3.5.
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6287
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5223
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.