SteveDingle
Programmer
Heya All,
I am "trying" to learn CSS, reading throught Eric Meyer's books and I have to admit total confusion POSITION.
I am trying to get awy from using Tables for layout and want to work out using DIV and POSITION: but I'm having a toatl brain fart and I'm totaly lost with the whats/whens of the different values (STATIC, ABSOLUTE etc..)
The goal of the code below is the have the #Header NEXT TO #Logo filling up the rest of the document all the way to the right
I found myself mixing matching, STATIC, ABSOLUTE and realised I was just guessing so thought it best to ask.
Thanks!!!
Toodles,
Steve Dingle
D&S Business Solutions Ltd
I am "trying" to learn CSS, reading throught Eric Meyer's books and I have to admit total confusion POSITION.
I am trying to get awy from using Tables for layout and want to work out using DIV and POSITION: but I'm having a toatl brain fart and I'm totaly lost with the whats/whens of the different values (STATIC, ABSOLUTE etc..)
The goal of the code below is the have the #Header NEXT TO #Logo filling up the rest of the document all the way to the right
I found myself mixing matching, STATIC, ABSOLUTE and realised I was just guessing so thought it best to ask.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<style type="text/css">
body {position: relative;
background: yellow;
margin: 0;
padding: 0;
}
#pagetop {
margin: 0;
padding: 0;
border: thin solid lime;
background: lime;
position: static;
top: 0;
left: 0;
width: 100%;
height: 118px;
}
#pagemiddle {
margin: 0;
padding: 0;
border: thin solid lime;
background: blue;
color: white;
position: relative;
width: 100%;
height: 100%;
}
#pagebottom {
margin: 0;
padding: 0;
border: thin solid lime;
background: green;
color: white;
position: absolute;
bottom: 0;
width: 100%;
height: 20px;
}
#logo {
display: inline;
margin: 0;
padding: 0;
border: thin solid black;
background: white;
position: static;
top: 0;
left: 0;
bottom: 0;
width: 141px;
height: 100%;
}
#heading {
display: inline;
margin: 0;
padding: 0;
border: thin solid black;
background: white;
position: static;
top: 0;
bottom: 0;
right: 0;
left: 142px;
height: 100%;
}
</style>
<body>
<div id="pagetop">
<div id="logo">
Logo
</div>
<div id="heading">
Heading
</div>
</div>
<div id="pagemiddle">
Middle
</div>
<div id="pagebottom">
Bottom
</div>
</body>
</html>
Thanks!!!
Toodles,
Steve Dingle
D&S Business Solutions Ltd