Hi, I just up and decided that I'd have a go at completely doing my next project in CSS rather than use any tables at all.
I'm having trouble getting my head around the positioning sytstem.
What I want is roughly this:
----------------------------------------
|orange box | blue box |
|180px wide | covers rest of window |
|75px high | 75px high |
----------------------------------------
| blue | orange (both 22px high) |
----------------------------------------
| | |
| | |
| | |
| Menu | Content |
| 180 wide | covers rest of window |
| 100% high | 100%high |
| | |
| | |
| | |
----------------------------------------
Now I have managed to do this using absolute positioning, by positioning each component exactly where it should be. But after reading a bit more, I think I might be on the wrong track with this and I wanted to check it before I go further.
CSS:
.top_container {
width: 100%;
height: 75px;
}
.top_left_box {
background-color: #FFCC33;
padding: 0px;
float: left;
position: absolute;
left: 0px;
top: 0px;
height: 75px;
width: 180px;
text-align: center;
vertical-align: middle;
}
.top_banner {
background-color: #CCFFFF;
padding: 0px;
float: left;
position: absolute;
left: 180px;
top: 0px;
height: 75px;
width: 100%;
}
.top_rule_left {
background-color: #000099;
position: absolute;
left: 0px;
top: 75px;
height: 22px;
width: 180px;
}
.top_rule_right {
background-color: #FFCC33;
position: absolute;
height: 22px;
width: 100%;
left: 180px;
top: 75px;
}
.left_menu_container {
background-color: #000099;
height: 470px;
width: 180px;
position: absolute;
left: 0px;
top: 97px;
}
HTML:
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles/ldc_main_styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="top_left_box"> </div>
<div class="top_banner"> </div>
<p> </p>
<p> </p>
<p class="top_rule_left"> </p>
<p> </p>
<p class="top_rule_right"> </p>
<p class="left_menu_container"> </p>
</body>
</html>
The exact problem i'm having is I want to put a logo in the top left container. It needs to be centered (done that) and also in the middle of the cell vertically.
I can't for the life work out how to do this using vertical-align or padding so I am starting to feel I'm digging myself into a hole and could be in trouble when it comes to insert more content.
Is absolute positioning definately the way I should be attacking this?
Thanks in advance.
I'm having trouble getting my head around the positioning sytstem.
What I want is roughly this:
----------------------------------------
|orange box | blue box |
|180px wide | covers rest of window |
|75px high | 75px high |
----------------------------------------
| blue | orange (both 22px high) |
----------------------------------------
| | |
| | |
| | |
| Menu | Content |
| 180 wide | covers rest of window |
| 100% high | 100%high |
| | |
| | |
| | |
----------------------------------------
Now I have managed to do this using absolute positioning, by positioning each component exactly where it should be. But after reading a bit more, I think I might be on the wrong track with this and I wanted to check it before I go further.
CSS:
.top_container {
width: 100%;
height: 75px;
}
.top_left_box {
background-color: #FFCC33;
padding: 0px;
float: left;
position: absolute;
left: 0px;
top: 0px;
height: 75px;
width: 180px;
text-align: center;
vertical-align: middle;
}
.top_banner {
background-color: #CCFFFF;
padding: 0px;
float: left;
position: absolute;
left: 180px;
top: 0px;
height: 75px;
width: 100%;
}
.top_rule_left {
background-color: #000099;
position: absolute;
left: 0px;
top: 75px;
height: 22px;
width: 180px;
}
.top_rule_right {
background-color: #FFCC33;
position: absolute;
height: 22px;
width: 100%;
left: 180px;
top: 75px;
}
.left_menu_container {
background-color: #000099;
height: 470px;
width: 180px;
position: absolute;
left: 0px;
top: 97px;
}
HTML:
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles/ldc_main_styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="top_left_box"> </div>
<div class="top_banner"> </div>
<p> </p>
<p> </p>
<p class="top_rule_left"> </p>
<p> </p>
<p class="top_rule_right"> </p>
<p class="left_menu_container"> </p>
</body>
</html>
The exact problem i'm having is I want to put a logo in the top left container. It needs to be centered (done that) and also in the middle of the cell vertically.
I can't for the life work out how to do this using vertical-align or padding so I am starting to feel I'm digging myself into a hole and could be in trouble when it comes to insert more content.
Is absolute positioning definately the way I should be attacking this?
Thanks in advance.