954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

CSS Navigation

page-about.php

<div id="AboutNav">					
		<h3>About</h3>
            <p style="border-bottom: 1px dotted #787878; width: 200px;"></p> 
				                
                	<a href="https://localhost/wordpress/about/about-vision.php">Vision & Mission</a>
                	<a href="https://localhost/wordpress/about/about-history.php">History</a>
                	<a href="https://localhost/wordpress/about/about-client.php">Client</a>
                    <a href="https://localhost/wordpress/about/about-people.php">People</a>
                </ul>    
            
</div>


style.css

#AboutNav h3 {
	margin: 20px 0 0 0;
	}
	
#AboutNav a:link{
	background: url('images/About/AboutNav2.png') 0 0;	
	width: 100px;
    text-decoration: none;
	color: black; Arial, Helvetica, sans-serif;	
	font-size: 12px;
	padding: 10px;
	display: block;
	}	

#AboutNav a:visited{
	background: url('images/About/AboutNav2.png') 0 20px;	
	width: 100px;
    text-decoration: none;
	color: red; Arial, Helvetica, sans-serif;	
	font-size: 12px;
	display: block;
	}		

#AboutNav a:hover{
	background: url('images/About/AboutNav2.png') 40 40px;	
	width: 100px;
    text-decoration: none;
	color: red; Arial, Helvetica, sans-serif;	
	font-size: 12px;
	padding: 10px;	
	display: block;
	}


The navigation appears like this: http://www.masterlink.co.id/page-about.php

Where it suppose to be like the attachment.

Can anyone help me identify why and offer me a solution ?

Attachments ock_about_client.jpg 44.56KB AboutNav2.png 4KB
davy_yg
Posting Whiz
377 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 

try by adding a

#AboutNav{

}

block in your css

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

What do you mean ?

davy_yg
Posting Whiz
377 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 

I mean this:

#AboutNav a:hover{
	background: url('images/About/AboutNav2.png') 40 40px;	
	width: 100px;
    text-decoration: none;
	color: red; Arial, Helvetica, sans-serif;	
	font-size: 12px;
	padding: 10px;	
	display: block;
	}

will be valid for every a tag you're hovering on, not for the background or container you've stored your menu in, create a separate style for that.

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

What's the difference between that and the code that wrote on line 25 - 33 ?

davy_yg
Posting Whiz
377 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 

that ís the code you wrote.
I just explained underneath why it doesn't work.

if you want (for instance) your entire AboutNav to have a grey background, you'll need to add something like this:

#AboutNav{
  background-color: grey;
}


because:

#AboutNav p{
  background-color: grey;
}


would NOT set the background color for the entire aboutnav, but only for the p elements that are within your div with id aboutnav.

if you want to test your css 'on-the-fly' you may be interested in this thread (especially in the link provided by the OP). http://www.daniweb.com/business-exchange/show-off-your-projects/threads/402989

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

Just learning HTML syntax and found this post very helpful.
Thanks a lot.
Sam
http://www.zeuscreative.co.uk/corporate-web-development-company

samgreensted
Newbie Poster
1 post since Feb 2012
Reputation Points: 10
Solved Threads: 0
 
Just learning HTML syntax and found this post very helpful. Thanks a lot. Sam


always nice to hear :)

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You