IamHe
04-15-2011, 12:23 PM
Hey guys, im trying to build a div/css layout
im tryying to line up a menu using divs
i want a spacer then the link
then a spacer again , then a link ..and so on
ensuring that every link has the same distance
the div that contains the link i wanted the width to just adjust to the width that the text takes up , but im having trouble getting them all to run on one line,
here is the code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<style type="text/css">
body {
background-color: #000;
}
#menu {
margin:auto;
width: 728px;
height: 32px;
padding: 0;
background: #caced1 url(menu.gif);
}
#linkspacer {
display: inline
width: 23px;
height: 32px;
padding: 0;
}
#link {
display: inline
width: auto;
height: 32px;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FFF;
line-height: 25px;
}
</style>
</head>
<body>
<div class="menu" id="menu">
<div class="linkspacer" id="linkspacer"></div>
<div class="link" id="link">Home</div>
<div class="linkspacer" id="linkspacer"></div>
<div class="link" id="link">About</div>
<div class="linkspacer" id="linkspacer"></div>
<div class="link" id="link">Pictures</div>
<div class="linkspacer" id="linkspacer"></div>
<div class="link" id="link">News</div>
<div class="linkspacer" id="linkspacer"></div>
<div class="link" id="link">Contact Us</div>
<div class="linkspacer" id="linkspacer"></div>
</div>
</body>
</html>
Appreciate any help , thanks allot :)
im tryying to line up a menu using divs
i want a spacer then the link
then a spacer again , then a link ..and so on
ensuring that every link has the same distance
the div that contains the link i wanted the width to just adjust to the width that the text takes up , but im having trouble getting them all to run on one line,
here is the code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<style type="text/css">
body {
background-color: #000;
}
#menu {
margin:auto;
width: 728px;
height: 32px;
padding: 0;
background: #caced1 url(menu.gif);
}
#linkspacer {
display: inline
width: 23px;
height: 32px;
padding: 0;
}
#link {
display: inline
width: auto;
height: 32px;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FFF;
line-height: 25px;
}
</style>
</head>
<body>
<div class="menu" id="menu">
<div class="linkspacer" id="linkspacer"></div>
<div class="link" id="link">Home</div>
<div class="linkspacer" id="linkspacer"></div>
<div class="link" id="link">About</div>
<div class="linkspacer" id="linkspacer"></div>
<div class="link" id="link">Pictures</div>
<div class="linkspacer" id="linkspacer"></div>
<div class="link" id="link">News</div>
<div class="linkspacer" id="linkspacer"></div>
<div class="link" id="link">Contact Us</div>
<div class="linkspacer" id="linkspacer"></div>
</div>
</body>
</html>
Appreciate any help , thanks allot :)