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.

Why won't this CSS code work for the link in my footer div tag?

Featured Replies

I've created a div tag called "footer", using an ID selector (#footer). I've tried to style the links within this div tag, this is the code I've written.

#footer a:link	{
	color: #FFF;
	text-decoration: underline;
}

#footer a:visited	{
	color: #FF0;
	text-decoration: underline;
}

#footer a:hover	{
	color: #CCC;
	text-decoration: none;
}

#footer a:visited:hover	{
	color: #FF0;
	text-decoration: underline;
}

They all work perfectly, apart from this one.

#footer a:visited:hover	{
	color: #FF0;
	text-decoration: underline;
}

When I preview my site in an internet browser and point to a visited link, it takes the underline away. The colours work properly, but the underline disappears (even though I've told it to underline it, as you can see in the code above).

 

Is there anyway I can correct this?

 

Thank you for any help.

  • Author

a:visited:hover needs to come before a:hover

Thank you for your help, I've changed my code to

#footer a:link	{
	color: #FFF;
	text-decoration: underline;
}

#footer a:visited	{
	color: #FF0;
	text-decoration: underline;
}

#footer a:visited:hover	{
	color: #FF0;
	text-decoration: underline;
}

#footer a:hover	{
	color: #CCC;
	text-decoration: none;
}

But it's still not working properly, is there anything else I can try?

 

Thank you for any help.

OK, this had me confused but it seems that we can only style the color of the :visited psuedo-class. (Apparently because people figured out a way to determine your browser history?). So any styles other than color will be ignored.

More details Here

  • Author

OK, this had me confused but it seems that we can only style the color of the :visited psuedo-class. (Apparently because people figured out a way to determine your browser history?). So any styles other than color will be ignored.

 

More details Here

OK, thank you for your help.

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.