Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-25-2013, 09:28 PM   PM User | #1
evilgandhi
New Coder

 
Join Date: Aug 2011
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
evilgandhi is an unknown quantity at this point
html css menu issue

hey there awesome people!!

i'm having problem on my rollovers to get my menu working?

the text and image seem to move a few pixels to the left on hover?

any help would be greatly appreciated...

http://gandhiproductions.herobo.com/...test/menu.html

thank you

Gandhi
evilgandhi is offline   Reply With Quote
Old 01-25-2013, 10:34 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello evilgandhi,
Do you like it better when you remove that negative margin? See highlighted in red -
Code:
nav li a:hover {
	position:absolute;
	height:100px;
	width:100px;
	margin:-2px;
	border:2px solid #a3a3a3;
}
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 01-25-2013, 10:46 PM   PM User | #3
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Maybe more like this?
Code:
nav li {
  height: 100px;
  width: 100px;
	background:#6194aa;
	float:left;
	list-style:none;
	margin-left:5px;
	
}
nav li a {
  height: 90px;
  width: 90px;
	position:absolute;
  padding: 5px;
	line-height:165px;
	text-decoration:none;
	color:#FFF;
	background-image:url(image/martani-icons.png);
  border: 2px solid transparent;
  display: block;
}

nav li a:hover {
  margin: -2px 0 0 -2px;
	border:2px solid #a3a3a3;
}
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 01-26-2013, 01:14 AM   PM User | #4
evilgandhi
New Coder

 
Join Date: Aug 2011
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
evilgandhi is an unknown quantity at this point
the above code isn't right either........ i don't want any movement....... the only thing that should appear is the 2px border around each box on hover.....

if you have a hotmail/outlook account login and click the arrow to the right of the outlook logo see the menu and drop from the top..

that what i what it to look like and function like (with out it dropping down)

here is a screenshot of said menu

http://gandhiproductions.herobo.com/...2001.09.45.png

thank you for help, and the speed of your response

G
evilgandhi is offline   Reply With Quote
Old 01-26-2013, 01:33 AM   PM User | #5
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
I see what you're wanting. Have a look at it this way -
Code:
nav li {
  height: 100px;
  width: 100px;
	background:#6194aa;
	float:left;
	list-style:none;
	margin-left:5px;
	
}
nav li a {
  height: 86px;
  width: 86px;
	position:absolute;
  padding: 5px;
	line-height: 155px;
	text-decoration:none;
	color:#FFF;
	background-image:url(image/martani-icons.png);
  border: 2px solid #fff;
  display: block;
}

nav li a:hover {border:2px solid #a3a3a3;}
Here's why that works - See the box model here. The box model says that whatever you put inside an element cannot be larger than that element. margin/padding/border all count when figuring width/height.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 01-26-2013, 01:36 AM   PM User | #6
evilgandhi
New Coder

 
Join Date: Aug 2011
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
evilgandhi is an unknown quantity at this point
legend.

thank very much!!!!

G
evilgandhi is offline   Reply With Quote
Reply

Bookmarks

Tags
css menu pixel move

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 08:27 PM.


Advertisement
Log in to turn off these ads.