Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Need help with my navigation bar
Old 02-19-2010, 06:27 AM Need help with my navigation bar
Junior Talker

Posts: 4
Name: Matthew Hamilton
Trades: 0
I'm a pretty new to CSS/HTML and im stuck at the moment trying to get my nav bar right at the top of the page.

At the moment my it looks like this



but I want to place the splitters inbetween and inline with the text so it looks like this



Heres my html code

Quote:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=screen>
<title>title goes here</title>
</head>

<body>
<div id="container">
<div id="header">
<div id="logo">
<img src="images/logo.png"/>
</div> <!--end logo-->

</div><!--end header-->

<div id="navBG">



<ul id="nav">
<li><a href="#">Products</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">What we do</a></li>
<li><a href="#">Community</a></li>
<li><a href="#">Contact</a></li>



</ul>


<ul id="splitters">
<img src="images/splitter.png" />
<img src="images/splitter.png" />
<img src="images/splitter.png" />
<img src="images/splitter.png" />
<img src="images/splitter.png" />
</ul>


</div><!--end nav-->


</div><!--end container-->


</body>
</html>
Heres my CSS

Quote:
/* v1.0 | 20080212 */

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
body {
line-height: 1;

}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}

/* remember to define focus styles! */
:focus {
outline: 0;
}

a {
text-decoration: none;

color: black;
}
a:hover{
text-decoration: underline;
}


/* ------------------ Main style -----------------*/


#container {
width:704px;
background:#dbdada;
margin: auto
}

#header {
margin-left: 2px;
overflow: hidden;
height: 100%; /* needed for IE6 */
height: 148px;
background: url(images/header.png) no-repeat;
}

#logo{
margin-top: 25px;
margin-left: 12px;
}

#header img{
float: left;
}

#navBG{
overflow: hidden;
width: 700px;
height: 39px;
margin-left: 2px;
background: #373737;
}

#nav{
padding-top: 10px;
padding-left: 30px;
}

#splitters{
position: absolute;

}

#nav li{
display: inline;
padding-right: 45px;
padding-left: 12px;
}

#nav li a{
color: white;
font-family:"Arial";
font-size: 10pt;
}
matt159 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-19-2010, 11:48 AM Re: Need help with my navigation bar
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
One suggestion:

You can just insert a background image in #nav li.

You position the image to the right and set to not repeat but target the last li to not use the background image. (Such as <li class="last-item">)

Good tutorial overview of lists here.
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 02-19-2010, 08:14 PM Re: Need help with my navigation bar
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Try adding a right or left border to:

#nav li a

You'll need to then add a class or id to the first or last link (depending on whether you use a right or left border) so you can style that one link specifically not to have one.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 02-19-2010, 09:32 PM Re: Need help with my navigation bar
YoshiGoneMad's Avatar
Novice Talker

Posts: 7
Trades: 0
Refer to this post: http://welovecss.com/showthread.php?t=4441
YoshiGoneMad is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need help with my navigation bar
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.56236 seconds with 12 queries