473,396 Members | 1,929 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.

How to create a CSS layout with verticaly variable area?

Hi there,
I need to create a classic layout like this:

------------------------\
top |
------------------------|
| | |
left| center |right|
| | |
| | |
| | |
------------------------|
bottom |
------------------------/

only with div sections and CSS1 or CSS2 stylesheet, but
where all area are verticaly variable, in other words, adjust
themselves with additional text.

?
Jul 20 '05 #1
4 3468
Hi there,

Let me ask it in other words:

consider the three columns technique with one fluid column center, as
in

http://www.glish.com/css/7.asp

with a top fixed area (with text: 'LAYOUT TECHNIQUES: 3 columns, the
holy grail')

My simple question is: is it *possible* with CSS1 or CSS2 this top
area and the three column to adjust themselves if i put more text in
the top area?

I can design that behaviour with tables and div sections, but not with
div sections only.

I would be satisfied of any answer ("yes" or "your question is
evident"): I must mention that I searched around the web and the
groups for the answer).

Best regards,

s_*********@hotmail.com (Marc-Olivier BERNARD) wrote in message news:<a8**************************@posting.google. com>...
Hi there,
I need to create a classic layout like this:

------------------------\
top |
------------------------|
| | |
left| center |right|
| | |
| |
| | |
------------------------|
bottom |
------------------------/

only with div sections and CSS1 or CSS2 stylesheet, but
where all area are verticaly variable, in other words, adjust
themselves with additional text.

?

Jul 20 '05 #2
On 19 Jun 2004 06:07:06 -0700, Marc-Olivier BERNARD
<s_*********@hotmail.com> wrote:
Hi there,

Let me ask it in other words:

consider the three columns technique with one fluid column center, as
in

http://www.glish.com/css/7.asp

with a top fixed area (with text: 'LAYOUT TECHNIQUES: 3 columns, the
holy grail')

My simple question is: is it *possible* with CSS1 or CSS2 this top
area and the three column to adjust themselves if i put more text in
the top area?


Of course. The top div will enlarge to hold its non-floated content.
However, if we position the columns with absolute positioning with respect
to the viewport, we have a problem.

The solution, therefore, is to do this:

<div id="header">
-- Header content --
</div>
<div id="wrap">
<div id="content">
-- Content for center section --
</div>
-- Other column divs --
</div>

Style like this: #wrap {position: relative;} The contained elements are
now positioned with respect to the wrap div.
Jul 20 '05 #3
On 19 Jun 2004 06:07:06 -0700, Marc-Olivier BERNARD
<s_*********@hotmail.com> wrote:

http://www.glish.com/css/7.asp


BTW, try looking at this in Opera 7.23, and then refreshing the display
(not reload). Interesting!
Jul 20 '05 #4
Thank you very much! I succesfully followed your advice.

With the resulting design template (see below), i encounter some
enoying problems with are, up to my mind, typical of CSS (in the state
of the art):
* overlay of information from a div box to another in the window gets
very small
* cross browser design problems (OK for mozilla/linux, mozilla/win2k,
konqueror/linux, but *Not OK* for IE6/win2k)
* div/CSS has great advantages over tables but I can not implement a
box with a fixed minimum size, feature I can implement with a fixed
width size transparent pixel image within a table cell

template:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>extensible header + 3 columns design</title>
<style type="text/css" media="all">

#wrap {position: relative;}

#leftcontent {
float: left;
width:200px;
border:1px solid #000;
}

#centercontent {
position: absolute;
top: 0px;
margin-left: 210px;
margin-right:210px;
}

#rightcontent {
float: right;
width:200px;
border:1px solid #000;
}

</style>
</head>
<body>

<div id="header">
<p>-- Header content -- </p>
</div>
<div id="wrap">
<div id="leftcontent">
<h1>leftcontent</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing
elit...</p>
</div>

<div id="centercontent">
<h1>centercontent</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing
elit...</p>
</div>

<div id="rightcontent">
<h1>rightcontent</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing
elit...</p>
</div>
</div>
</body>
</html>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Neal <ne*****@yahoo.com> wrote in message news:<op**************@news.individual.net>...
On 19 Jun 2004 06:07:06 -0700, Marc-Olivier BERNARD
<s_*********@hotmail.com> wrote:
Hi there,

Let me ask it in other words:

consider the three columns technique with one fluid column center, as
in

http://www.glish.com/css/7.asp

with a top fixed area (with text: 'LAYOUT TECHNIQUES: 3 columns, the
holy grail')

My simple question is: is it *possible* with CSS1 or CSS2 this top
area and the three column to adjust themselves if i put more text in
the top area?


Of course. The top div will enlarge to hold its non-floated content.
However, if we position the columns with absolute positioning with respect
to the viewport, we have a problem.

The solution, therefore, is to do this:

<div id="header">
-- Header content --
</div>
<div id="wrap">
<div id="content">
-- Content for center section --
</div>
-- Other column divs --
</div>

Style like this: #wrap {position: relative;} The contained elements are
now positioned with respect to the wrap div.

Jul 20 '05 #5

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

Similar topics

0
by: Merlin_1102 | last post by:
I have read previous posts on the gridbaglayout and none seem to answer my questions (sorry if any of these have been aske dI really did search and found one large thread which took me an hour to...
10
by: Ed | last post by:
The page I'm working on is at http://www.coldpizzasoftware.com/temp/layout.html I trying to get the yellow sidebar to go in the white area to the right of the green content area and between the...
5
by: Rick Spiewak | last post by:
I'm using a DataList inside a Grid Layout Panel (which ends up being a <DIV>) so that I can use the overflow:scroll property. This is working fine, except for one anomaly: If there aren't enough...
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
2
by: Edward | last post by:
I'm pursuing the holy grail of creating a two-column CSS layout with footer AND where the colors of the columns actually go all the way down. The code is below. Here is a graphic of how it...
7
by: Trammel | last post by:
Im trying to do something which I hoped would be alot easier than it seems. Im trying to design the layout of the page in CSS to avoid table, etc but having problems making the bottom "fade"...
8
by: dixzyt | last post by:
Hi I wonder if anyone would be so kind as to help me with this issue that's driving me nuts! The webpage below displays correctly on IE & Opera but NOT on Firefox 2.0.
15
by: pbd22 | last post by:
Hi. I want to create a tab with a little "active tab" arrow below it to tell the user where they are. An example is here: http://personals.yahoo.com/us/search/dashboard Does anybody know of...
9
by: greenelephant | last post by:
Hello i am new to the site and registered cause it looks like i can get the help i need here. So the help i need besides mental help is a problem with getting so things to align for me properly. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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...
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...

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.