Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Web Design & Development Web Design & Development
Search Search
Search for:
Tech Support Guy Forums > > >

Solved: CSS Rollover issue


(!)

Phlum's Avatar
Phlum   (Tim) Phlum is offline
Computer Specs
Member with 39 posts.
THREAD STARTER
 
Join Date: Apr 2009
Experience: Intermediate
13-Sep-2012, 11:28 AM #1
Unhappy Solved: CSS Rollover issue
Hi

I'm making a navigation bar entirely out of images. For each clickable image, this syntax is used:
HTML Code:
<span class="nav-item"><a href="something.htm"><img src="button.png"></a></span>
along with an extra divider image in between each nav image.

I have five of these - however, only four of them work properly. The first does not work at all - I can't click it and it doesn't have a rollover. But I can't see anything wrong with it.

The full HTML for the navigation bar is as follows:
HTML Code:
<nav id="navigation">
	<span class="nav-item"><a href="#"><img src="Home-button.png"></a></span>
	<img src="navdiv.png">
	<span class="nav-item"><a href="#"><img src="Blog-button.png"></a></span>
	<img src="navdiv.png">
	<span class="nav-item"><a href="#"><img src="Foo-button.png"></a></span>
	<img src="navdiv.png">
	<span class="nav-item"><a href="#"><img src="Bar-button.png"></a></span>
	<img src="navdiv.png">
	<span class="nav-item"><a href="#"><img src="Contact-button.png"></a></span>
</nav>
And the CSS to make the rollovers work is as follows:
Code:
nav a img:hover {
	background-color: #333;
	}
Can anybody see what I'm doing wrong, if anything?

Cheers
-phlum

Edit: I removed the Home button, therefore making the first button "Blog" - but it didn't make any difference. I also tried putting in a divider image before it, with no joy... The issue seems to be with the first button in the bar and not specifically Home.

Last edited by Phlum; 13-Sep-2012 at 12:44 PM..
Ent's Avatar
Ent   (Josiah) Ent is offline Ent is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 4,874 posts.
 
Join Date: Apr 2009
Location: United Kingdom
Experience: Intermediate
13-Sep-2012, 01:05 PM #2
These may be completely unrelated to your question, but...
I'm not quite sure why you're putting those <span> tags around them since you're not doing anything. Why not just set class="nav-item" to the <a> tags?
What do you mean by you can't click it; if the link doesn't go anywhere what would you expect to happen?
__________________
I don't read minds. Please help everyone by answering any questions and reporting on the results of any suggestions.
Our Library of Knowledge is provided for your use. Can you help to improve it?
Phlum's Avatar
Phlum   (Tim) Phlum is offline
Computer Specs
Member with 39 posts.
THREAD STARTER
 
Join Date: Apr 2009
Experience: Intermediate
13-Sep-2012, 01:20 PM #3
Usually with href="#" it goes to the top of the page. It won't work with this button - not even changing where it leads. The rest work as they should - the background changes when they're rolled over, the link works, etc.

I've done as you said with the <span>s and it looks a lot cleaner now. Thanks
Ravenswd's Avatar
Member with 1 posts.
 
Join Date: Sep 2012
Experience: Intermediate
14-Sep-2012, 07:01 PM #4
I created a bare page with nothing on it but the code you provided, and it worked fine. My only guess is that there must be something else on the page that's somehow interfering with it. You might want to make a copy of the page and strip out other elements one at a time until it starts working. Also, if you could (privately) link me to the actual page I could take a closer look.
Ent's Avatar
Ent   (Josiah) Ent is offline Ent is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 4,874 posts.
 
Join Date: Apr 2009
Location: United Kingdom
Experience: Intermediate
15-Sep-2012, 06:42 AM #5
Ravenswd, thank you for trying to help on Tech Support Guy.
In general we prefer for help to remain on the forums. Unless there is an exceptionally good reason for it, private discussions are avoided because a) they rule out the possibility that someone else can help find the solution and b) they don't leave a trail of instructions on the site to assist others with the same problem.

There is, however, nothing wrong with linking to a broken site publicly or pasting the whole of the HTML into the thread.
__________________
I don't read minds. Please help everyone by answering any questions and reporting on the results of any suggestions.
Our Library of Knowledge is provided for your use. Can you help to improve it?
Phlum's Avatar
Phlum   (Tim) Phlum is offline
Computer Specs
Member with 39 posts.
THREAD STARTER
 
Join Date: Apr 2009
Experience: Intermediate
15-Sep-2012, 07:21 AM #6
I found the issue: the header image is quite large since it has a shadow, and it was covering up the home button. Silly me...
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


Tags
button, css, html, image, rollover

(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑