Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > BOOK: Beginning HTML, XHTML, CSS, and JavaScript
|
BOOK: Beginning HTML, XHTML, CSS, and JavaScript
This is the forum to discuss the Wrox book Beginning HTML, XHTML, CSS, and JavaScript by Jon Duckett; ISBN: 978-0-470-54070-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning HTML, XHTML, CSS, and JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2011, 02:54 PM
Registered User
 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default text-decoration in visited and hover not working

Hi-
I am working on example 1 in chapter 8, and I notice that my text-decoration property is not working in css visited or active pseudo-classes of links. The color property works fine, but the visited (a:visited) text-decoration seems to take whatever the link (a:link) text-decoration is and the active (a:active) seems to take whatever the hover (a:link:hover) text-decoration is. Any help is much appreciated. Thank you.

here is my code:
Code:
/* style sheet demonstrating styles of links */

body {background-color:#ffffff;}

a {
  font-family: arial, verdana, sans-serif; 
  font-size:12px;
  font-weight:bold;}

a:link {
  color:#0000ff;
  text-decoration:line-through;}

a:visited {
  color:#333399;
  text-decoration:none;}

a:active {
  color:#008000;
  text-decoration:none;}

a:link:hover {
  background-color:#e9e9e9;
  text-decoration:underline;}

Last edited by liucc; July 17th, 2011 at 03:00 PM..
 
Old September 4th, 2011, 03:26 PM
Registered User
 
Join Date: Apr 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First of all a:link:hover should be a:hover and second you should always place a:active below it's considered good practice and it could cause rendering problems. Hope this solves your problem
 
Old September 11th, 2011, 02:14 PM
Registered User
 
Join Date: Aug 2011
Posts: 13
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You must to define the anchor pseudo-classes in this order:-

a:link
a:visited
a:hover
a:active

Each one of these pseudo-classes defines itself and the ones that come after it in the list. Because you have hover after active, both will appear the same, i.e. way that [I]hover[I] is defined.





Similar Threads
Thread Thread Starter Forum Replies Last Post
'Exception' is not counting the no. of times the mouse hover on the text. arbab BOOK: Beginning JavaScript and CSS Development with jQuery 2 May 31st, 2011 02:18 AM
Chapter 3 - a:visited not working VeganMan BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 April 3rd, 2008 12:31 AM
IE6: Hover stops working on AJAX page sigilaea Ajax 0 March 17th, 2008 09:58 AM
Hover/Text Decoration Weirdness interrupt CSS Cascading Style Sheets 2 August 8th, 2005 09:11 AM
Problem with text-decoration in cascaded <li> setesteve CSS Cascading Style Sheets 6 January 7th, 2005 10:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.