Our November Competition
User Reviews - Add Yours!
The PCHF Lounge
Go Back   PC Help Forum » Web & Networking » Web Design
Register for a Free Account

Web Design - "a:hover" posted in the Web & Networking forums; Hi all, just doing another practise page and just experimenting with navigation bars, and in the CSS I'm setting two different properties for the "a:hover" element. However, I'm getting some ...


Reply
Free PC Performance Scan
Old 3 Weeks Ago   #1
Silver Member
 
Join Date: Dec 2007
Posts: 137
PC Experience: Experienced
Default "a:hover"

Hi all, just doing another practise page and just experimenting with navigation bars, and in the CSS I'm setting two different properties for the "a:hover" element. However, I'm getting some of the effects from the first a:hover on the second and don't know how to correct this.

The code...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><title>Navigation Bars</title>

<style type="text/css">


.scott {margin-left: 10px;}



#nav li {display: inline;
padding-right: 3em;
padding-left: 3em;
padding-top: 10px;
padding-bottom: 4px;
background-color: black;
color: white;
font-size: 22px;}






a:link, a:visited {color: white;
text-decoration: none;}

a:hover {border: 1px dotted #800517;
color: red;
background-color: white;}






.a {background-color: #747170;
border-style: outset;
color: black;
font-size: 25px;
width: 150px;
text-align: center;
margin-bottom: 7px;}




.a a:link, a: visited {color: black;}

.a a:hover {color: white;
text-decoration: none;
background-color: #747170;}








</style>

</head>

<body>

<div class="scott">

<table>

<tr>

<td>

<ul id="nav">
<li><a href="home.htm">Home</a></li>
<li><a href="author.htm">The Author</a></li>
<li><a href="downloads.htm">Downloads</a></li>
<li><a href="contact.htm">Contact</a></li>
</ul>

</div>



<div class="a">

<a href="home.htm">Home</a></div>

<div class="a">
<a href="author.htm">The Author</a></div>

<div class="a">
<a href="downloads.htm">Downloads</a></div>

<div class="a">
<a href="contact.htm">Contact</a></div>


</div>



</body>

</html>




It's in the div class that I simpy named "a" that is still getting the effects from the first "a:hover" in the CSS list like the 1px dotted border with the #800517 colour.

I'm not sure how to correct this.


Thanks in advance!!
Tygra is offline   Reply With Quote
Advertisement - Register to Remove

Old 3 Weeks Ago   #2
Mod Team Leader
 
smokeycheech's Avatar
 
Join Date: Dec 2005
Location: Skynet HQ (kinda near PCHF bunker)
Posts: 2,183
PC Experience: Learning more every day!
Default re: "a:hover"

Hello Tygra - Welcome back!

I have opened your thread so as to get some useful input for you

Regards,

Smokeycheech
__________________
If an elephant never forgets, how come they never win mastermind?
smokeycheech is offline   Reply With Quote
Old 3 Weeks Ago   #3
Site Manager
 
upgrader's Avatar
 
Join Date: Jul 2006
Location: /home/upgrader/
Posts: 7,250
PC Experience: Some Experience
Default re: "a:hover"

Hi Tygra,

Add "border: 0px" to the .a a:hover, that will sort it. However, the best method would be to put the top navigation links into a separate class too (or use #nav a:hover) as that would isolate the code.
__________________
PCHF Rules--PCHF Prework--PCHF Downloads
upgrader is offline   Reply With Quote
Old 3 Weeks Ago   #4
Silver Member
 
Join Date: Dec 2007
Posts: 137
PC Experience: Experienced
Default re: "a:hover"

Thanks Smokeycheech; and thanks Upgrader that has sorted the problem.

Upgrader, I don't suppose you know how to do drop down menus do you? As this is something I'd like to be able to do.
Tygra is offline   Reply With Quote
Old 3 Weeks Ago   #5
Site Manager
 
upgrader's Avatar
 
Join Date: Jul 2006
Location: /home/upgrader/
Posts: 7,250
PC Experience: Some Experience
Default Re: "a:hover"

Try a google search for "css drop-down menus", you should get loads of results. If you get stuck with any tutorials, just ask
__________________
PCHF Rules--PCHF Prework--PCHF Downloads
upgrader is offline   Reply With Quote
Old 2 Weeks Ago   #6
Silver Member
 
Join Date: Dec 2007
Posts: 137
PC Experience: Experienced
Default Re: "a:hover"

Upgrader, I found a tutorial, copied out and it worked, however I don't understand all of it, and I would'nt be sure how to make my own drop down menus with my own layout.

Here is the link to the tutorial page
CSS Pop-Out Menu Tutorial Page 1

Basically I understand everything up to "Absolutely Positioning, Relatively speaking". I understand some of it, but I need some help with the order that the "ul, ul, ul, li:hover, ul," etc, etc go in, I don't understand why they go in the orders that they do, and that's what I need to understand.
Tygra is offline   Reply With Quote
Old 2 Weeks Ago   #7
Silver Member
 
Join Date: Dec 2007
Posts: 137
PC Experience: Experienced
Default Re: "a:hover"

Upgrader, are you there mate?
Tygra is offline   Reply With Quote

Reply

Bookmarks

Tags
ahover, Open:

Thread Tools
Display Modes

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 On




All times are GMT. The time now is 03:44 AM.
Powered by vBulletin
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2