Reply
Navbar selection
Old 12-26-2007, 03:21 PM Navbar selection
melefire's Avatar
Experienced Talker

Posts: 38
Name: matt
I have a HTML page and a style sheet the section of html for the "navbar" is:
HTML Code:
<ul id="nav">
<li><a href="index.html">Home</a></li>
<li><a href="clients.html">Clients</a></li>
<li><a href="services.html">Services</a></li>
<li><a href="about.html">About Us</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
and the style sheet is:
HTML Code:
* {
	padding:0;
	margin:0;
}

body {
	color: #333333;
	background-color:#FFFFFF;
	font-family:Arial, sans-serif;
	font-size:0.83em;
	margin:20px auto;
	width:650px;
        padding-left:10px;
        padding-right:10px;
}

h1, h2, h3, h4, h5, h6, p, pre, blockquote, label, ul, ol, dl, 
fieldset, address { margin:0.75em 0;}

h1 {font-size:1.67em;}

h2 {font-size:1.39em;}

h3 {font-size:1.2em;}

h4 {font-size:1em;}

u {color:#000000;}

li, dd { 
	margin-left:2em;
}

a {
        color: #3366CC;
        background-color: #FFFFFF;
        font-weight: normal;
        text-decoration: none;
	outline:none;
}

a:hover {
        color: #0033CC;
        background-color: #FFFFFF;
        font-weight: normal;
        text-decoration: underline;
}

a:link {
		color:#27408B
}

a:visited {
		color:#71637D
}

.image_paragraph_right {
	float: right;
	margin-top:0px;
	margin-left:20px;
	margin-bottom:5px;
}

.image_paragraph_left {
	float: left;
	margin-top:0px;
	margin-right:20px;
	margin-bottom:5px;
}

.image_section_right {
	float: right;
	margin-top:20px;
	margin-left:20px;
	margin-bottom:10px;
}

.image_section_left {
	float: left;
	margin-top:20px;
	margin-right:20px;
	margin-bottom:10px;
}

#title {
        color:#3366CC;
        background-color:#FFFFFF;
        font-size:3em;
        font-weight:normal;
	margin:0px 0px 0px 0px;
        float:left;
}

#slogan {
	color:#000000;
	background-color:#FFFFFF;
	font-size:small;
	font-weight:bold;
	padding:0px 0px 0px 0px;
	float:right;
	margin:0px 0px 0px 0px;
}

ul#nav {
	clear:both;
	float:left;
	margin: 0;
	padding: 0;
	list-style: none;
	width:650px;
}

ul#nav li {
	margin: 0;
	padding: 0;
	float: left;
	width:20%;
	text-align: center;
}

ul#nav li a {
	display: block;
	font-size: small;
	color: #FFFFFF;
	font-weight: bold;
	text-decoration: none;
	background: #000000;
	padding: 2px 0px 2px 0px;
}

ul#nav li a:hover { background: #3366CC; color: #FFFFFF; }
ul#nav a.selected:link { background: #3366CC; color: #FFFFFF; }
ul#nav a.selected:visited { background: #3366CC; color: #FFFFFF; }

#maincontent {
	font-size:1.0em;
	padding:0px 5px 5px 0px;
	margin:10px 0px 10px 0px;
	width:650px;
	float:left;
}


#footer {
	color:#000000;
	background-color:#FFFFFF;
	border-top:1px solid #0033CC;
	font-size:80%;
	line-height:1.5em;
	width: 650px;
	clear:both;
}

#footer a {
        color:#3366CC;
        background-color:#FFFFFF;
        text-decoration: none;
}

#footer a:hover {
        color:#0033CC;
        background-color:#FFFFFF;
        font-weight: normal;
        text-decoration: underline;
}

#copyright {
	color:#000000;
	background-color:#FFFFFF;
	padding:5px 20px 5px 0px;
	float:left;
}

#footercontact {
	color:#0033CC;
	background-color:#FFFFFF;
	padding:5px 0px 5px 0px;
	float:right;
}

#service1 {
    float:left
}

#service2 {
    float:right
}

#servicepic {
    float:center
}
so what im trying to do is find out what i need to put in the html to make the link on the navbar highlighted, as if you mouse was over it. i need it like this because i need some sort of indicator as to what page you are on.



thanks
melefire is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 12-26-2007, 04:13 PM Re: Navbar selection
Novice Talker

Posts: 7
good code .I try this code and work fine
powerfullman is offline
Reply With Quote
View Public Profile
 
Old 12-26-2007, 04:14 PM Re: Navbar selection
LadynRed's Avatar
Super Moderator

Posts: 6,743
Location: Tennessee
Create a class for the 'current' menu item, your link would look something like this:

<li><a class="current" href="xxxxxx.html">menu item</a></li>

Set the rules for the current class to be a different color or background image.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Navbar selection
 

Thread Tools

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

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


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


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

 


Page generated in 0.11377 seconds with 12 queries