473,398 Members | 2,188 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,398 software developers and data experts.

CSS+Div Prolbem

Hi There,

I have a problem with an xhtml/css layout.

I habe 3 divs:

1) Header (height: 20px)
2) Content(height: ...) *
3) Footer (height: 20px)

The three div's are among each other. The content div should fill the
page so that the footer is always at the bottom of the page.

I tried this one here: http://clients.frixxx.de/xhtml/test01.html

This is kinda right but the scrolling should'nt be if the text is as
short as in this content div.

Maybe someone can help.

Sorry for my bad english.

cU M.Göbels
Jul 23 '05 #1
2 1722
Matthias Göbels wrote:
Hi There,

I have a problem with an xhtml/css layout.

I habe 3 divs:

1) Header (height: 20px)
2) Content(height: ...) *
3) Footer (height: 20px)

The three div's are among each other. The content div should fill the
page so that the footer is always at the bottom of the page.

I tried this one here: http://clients.frixxx.de/xhtml/test01.html

This is kinda right but the scrolling should'nt be if the text is as
short as in this content div.

Maybe someone can help.

Sorry for my bad english.

cU M.Göbels


First, you don't need the body height, margin, or border entries. Ditto
for the html, body entries.

If you want the header and footer divs to be a fixed amount, then use
height: for those. Remove the content div height: entry and then the
content area will grow or shrink with the amount of information in it.

I use the body section for global text attributes and background color
other than the div colors. If the divs fill the entire area, the body
background will not be visible

body {

}

#header {
background:#f00;
height: 20px;
margin: 0;
padding: 0;
}

#content {
background:#0f0;
margin:0;
padding:0;
}

body>#content{height:auto;}

#footer {
background:#00f;
height: 20px;
margin: 0;
padding: 0;
}

Wayne
Jul 23 '05 #2
wayne wrote:
First, you don't need the body height, margin, or border entries. Ditto for the html, body entries.

If you want the header and footer divs to be a fixed amount, then use
height: for those. Remove the content div height: entry and then the
content area will grow or shrink with the amount of information in it.

I use the body section for global text attributes and background color
other than the div colors. If the divs fill the entire area, the body
background will not be visible

body {

}

#header {
background:#f00;
height: 20px;
margin: 0;
padding: 0;
}

#content {
background:#0f0;
margin:0;
padding:0;
}

body>#content{height:auto;}

#footer {
background:#00f;
height: 20px;
margin: 0;
padding: 0;
}

Wayne


Hi,

But if i write just about 2 words then the footer is not at the bottom
aof the window.

The footer should be at the bottom of the window if there are some words
and if there are very much words it should be the end of the page.

M.Göbels
Jul 23 '05 #3

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

Similar topics

3
by: Orson | last post by:
I have a CSS div defined as follows : <div id="col-2" > In some circumstances I want to change its width. I have tried all the following within a javascript function: ...
6
by: paulroskilly | last post by:
Hello, Can anyone help with this, I have a div tag : <div style="overflow:scroll; overflow-x:hidden; height=315px"> In IE this renders the DIV fine, it is 315 pixels high and has a...
2
by: Joey | last post by:
Hello all, I have been designing a site where the main content is enclosed in one table, and that table needs to be centered (the centering is done by using another container such as a div or...
4
by: greg.mckone | last post by:
Hi folks, I've been using CSS for style for several years now, but I've never attempted a layout using CSS. (I'd like to move away from tables) I'm working on a page here:...
5
by: Mr Brown | last post by:
Hi, I have a div <div class="lrgBG">, followed by a footer div <div class="lrgFooter">. I have an image and a table in the lrgBG div, image is floating left and the table is floating right. the...
4
by: Dave | last post by:
TIA for the help.....this should be easy for a pro....I need the two divs with text to display on the same line at the top of the container..??? <html> <head> <style> body...
11
by: Benny123 | last post by:
Im very new to the who css lark so am struggling quite a bit. ive managed to build a basic div centred box with css embedded in my html. It looks fine in IE but loses all size in firefox. Any...
4
by: woody79 | last post by:
My HTML: <div style="position:relative;"><div id="mainbody"> <div class="containers"> <div class="tl"></div> <div class="tm">Articles</div> <div class="tr"></div> </div> <div...
9
by: DevInCode | last post by:
Hi I'm trying to get a css layout working. One so I can use it, and two just to refine my css skills. The idea is that each part of the page (left pane, right pane, middle pane etc) have a...
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
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,...
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
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...

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.