Website Babble Webmaster Forums  


Go Back   Website Babble Webmaster Forums > Creating a Website > HTML, PHP, CSS, Javascript & Coding/Programming Topics

Your WB Notifications

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-21-2009, 07:12 AM
wbmkk's Avatar
Junior Babbler
 
Join Date: Oct 2009
Location: Whitley Bay, United Kingdom
Posts: 17
wbmkk has no reputation at Website Babble yet.
Default Horizontal navigation links move

I've been working through Lisa's CSS tutorials, which have been very useful.

I've set up the horizontal navigation section and added 4 links. These work fine, but whenever the mouse is moved over or the link, all the links seem to move to the right slightly

I'm not really sure why

Here is my css for the section concerned

.navlinks{
position:absolute;
top:4px;
left:240px;
}

.navlinks ul {
margin: auto;
}

.navlinks li {
margin: 0px 15px 0px 15px;
list-style-type:none;
display:inline;
}

.navlinks li a {
color:#000000
padding: 5px 12px 5px;
text-decoration:none;
font-size:16px;
font-family:Verdana;
font-weight:bold;
}

.navlinks li a:hover{
color:#cc0000;
padding:5px 12px 5px;
font-size:16px;
font-family:Verdana;
font-weight:bold;
background-color:blue;
}

Any help would be greatly appreciated
Reply With Quote
  #2 (permalink)  
Old 10-22-2009, 03:03 PM
meloncholy's Avatar
Master Babbler
 
Join Date: May 2009
Posts: 158
meloncholy has an outstanding reputation at WB (over 500 points)meloncholy has an outstanding reputation at WB (over 500 points)meloncholy has an outstanding reputation at WB (over 500 points)meloncholy has an outstanding reputation at WB (over 500 points)meloncholy has an outstanding reputation at WB (over 500 points)meloncholy has an outstanding reputation at WB (over 500 points)
Default

You've missed a semicolon from the color property in .navlinks li a, so it's ignoring the padding. This means you'll get a big jump when it does recognise the padding in a:hover.

While I'm here, you have quite a bit of unnecessary code in the section you pasted. A lot of styling properties are inherited from their parents, so you don't need to repeat them. You could reduce the a:hover to

Code:
.navlinks li a:hover { color: #c00; background-color: blue; }
__________________
Pole Exercise - Pole dancing evolved
Reply With Quote
  #3 (permalink)  
Old 10-23-2009, 03:35 AM
wbmkk's Avatar
Junior Babbler
 
Join Date: Oct 2009
Location: Whitley Bay, United Kingdom
Posts: 17
wbmkk has no reputation at Website Babble yet.
Default THANK YOU

Thanks Meloncholy for your comments.

Good eyesight too, to spot my mistake

I was working through Lisa's example trying to understand it as I went on, so the basic formatting is a direct copy of hers

However, when the words were moving, i thought maybe I had different fonts and sizes etc for the various links, so tried to make sure they were all in and the same. that's probably were any extra code came from

I eventually assumed it was something to do with the padding or margins, maybe after I had posted my question, so put everything to zero and it works.

Regards !
Reply With Quote
Reply

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 On
Pingbacks are On
Refbacks are On




All times are GMT -6. The time now is 01:57 AM.


 Subscribe to RSS

WB Sponsors

Search Engine Optimization

flash chat

Home Jobs Online

Search Engine Marketing

Paid Surveys

Web Design Company

custom website design

Best Links Management Software

Online Advertising Solution FREE trial!



 Subscribe to the Website Babble Feeds

2 Create a Website Homepage | 2 Create a Website Blog


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0