jollydonkey
Technical User
Hello,
I'm hoping someone can help me here.
I'm trying to use a tableless layout, using only css for positioning. I'd like to have a centered layout, with elements absolutely positioned within a centered container.
See
If you look at the css source code, can someone tell me why I'm forced to use minus -8px from the top edge for the tab image? I think it should be 0 px, however, if I do that, the contact tab is not flush with the top edge of the browser.
Also, how do I get the top tab flush with the browser edge using IE explorer 6.0+? Is there something I should be considering in my CSS code? Have I missed something?
Also, should I be using a bunch of <div> tags for each element image in my HTML code? If not, what's the best way?
Any help would be greatly appreciated.
Best,
JD.
I'm hoping someone can help me here.
I'm trying to use a tableless layout, using only css for positioning. I'd like to have a centered layout, with elements absolutely positioned within a centered container.
See
If you look at the css source code, can someone tell me why I'm forced to use minus -8px from the top edge for the tab image? I think it should be 0 px, however, if I do that, the contact tab is not flush with the top edge of the browser.
Also, how do I get the top tab flush with the browser edge using IE explorer 6.0+? Is there something I should be considering in my CSS code? Have I missed something?
Also, should I be using a bunch of <div> tags for each element image in my HTML code? If not, what's the best way?
Any help would be greatly appreciated.
Best,
JD.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
background-color: #191919;
text-align: center;
}
div#container
{
margin-left: auto;
margin-right: auto;
width: 780px;
text-align: left;
position:relative
}
#logo
{
position: absolute;
left: 7px;
top: 20px;
}
#anchor
{
position: absolute;
left: 0px;
top: 82px;
}
[COLOR=red]
#tab
{
position: absolute;
vertical-align:top;
right: 0px;
top: -8px;
}
[/color]
#navigation
{
position: absolute;
vertical-align:top;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#FFF;
right: 59px;
top: 18px;
}
-->
</style></head>
<body>
<div id="container">
<div id="logo"><img src="img/jd_logo.gif" width="176" height="41" /></div>
<div id="anchor"><img src="img/taxis.jpg" width="780" height="585" /></div>
<div id="tab"><img src="img/tab.gif" width="165" height="60" /></div>
<div id="navigation">Contact</div>
</div>
</body>
</html>