Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Navigation Hover Effect

Featured Replies

Hiya, I currently have this code for a hover effect for my navigation:

 

ul#navigation {
width: 573px;
height: 41px;
margin: 20px auto 0 auto;
padding: 0;
background: url(images/navigation_background.png) no-repeat;
}
ul#navigation li {
	float: left;
	margin: 2px 2px 0 2px;
	list-style: none;
	width: 110.5px;
	height: 37px;
	text-align: center;
	line-height: 40px; /* Center the text horizontally to the height of the ul */
	font-family: Calibri;
	font-size: 18px;
	color: #ffffff;
	background: url(images/navigation_button.png) no-repeat;
}

ul#navigation li:hover {
	background: url(images/navigation_highlight.png) no-repeat;
	width: 110.5px;
	height: 37px;
}

 

	<!-- Navigation -->
	<ul id="navigation">
		<li><a href="index.html" title="Home">Home</a></li>
		<li><a href="#" title="About">About</a></li>
		<li><a href="#" title="News">News</a></li>
		<li><a href="#" title="Events">Events</a></li>
		<li><a href="#" title="Contact">Contact</a></li>
	</ul>

 

But I'm having trouble with Google Chrome not displaying it correctly; I'm wondering if anyone can spot the problem?

 

Btw, It works fine in Firefox, Safari, IE 8!

 

This is the problem I'm getting:

 

post-11942-127168387233_thumb.png

 

What it's like in Firefox:

post-11942-127168387275_thumb.png

Edited by AdamConder

some browsers dont accept the :hover class apart from on links, so maybe try styling the links within the list instead of the list items

eg:

ul#navigation li a:link, ul#navigation li a:visited {
               display: block;
               float: left;
               margin: 2px 2px 0 2px;
               list-style: none;
               width: 110.5px;
               height: 37px;
               text-align: center;
               line-height: 40px; /* Center the text horizontally to the height of the ul */
               font-family: Calibri;
               font-size: 18px;
               color: #ffffff;
               background: url(images/navigation_button.png) no-repeat;
       }

       ul#navigation li a:hover {
               background: url(images/navigation_highlight.png) no-repeat;
               width: 110.5px;
               height: 37px;
       }

hope this helps

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.