2012-04-25 45 views
8

Đây là một trong các liên kết trong nav của tôi:Liên kết mặc định màu xanh và màu tím, cách xóa?

<li><a href="#live-now" class="navBtn"><span id="navLiveNow" class="white innerShadow textShadow">Live Now</span></a></li> 

Tôi cũng có những điều sau đây trong css của tôi:

a { text-decoration: none; } 
a:visited { text-decoration: none; } 
a:hover { text-decoration: none; } 
a:focus { text-decoration: none; } 
a:hover, a:active { text-decoration: none; } 

Nhưng các liên kết vẫn hiển thị trong khủng khiếp màu xanh/tím truy cập/hover html mặc định. Tôi đang làm gì sai?

Trả lời

16

Bạn cần phải ghi đè lên các màu:

a { color:red } /* Globally */ 

/* Each state */ 

a:visited { text-decoration: none; color:red; } 
a:hover { text-decoration: none; color:blue; } 
a:focus { text-decoration: none; color:yellow; } 
a:hover, a:active { text-decoration: none; color:black } 
0

Hey xác định màu #000 vào như như bạn và sửa đổi css của bạn như là như thế này

.navBtn { text-decoration: none; color:#000; } 
.navBtn:visited { text-decoration: none; color:#000; } 
.navBtn:hover { text-decoration: none; color:#000; } 
.navBtn:focus { text-decoration: none; color:#000; } 
.navBtn:hover, .navBtn:active { text-decoration: none; color:#000; } 

hay này

li a { text-decoration: none; color:#000; } 
li a:visited { text-decoration: none; color:#000; } 
li a:hover { text-decoration: none; color:#000; } 
li a:focus { text-decoration: none; color:#000; } 
li a:hover, .navBtn:active { text-decoration: none; color:#000; } 
0

Nếu bạn muốn hiển thị các neo theo lựa chọn màu sắc của riêng bạn hơn là bạn nên xác định màu sắc trong sở hữu thẻ neo trong CSS như thế này: -

a { text-decoration: none; color:red; } 
a:visited { text-decoration: none; } 
a:hover { text-decoration: none; } 
a:focus { text-decoration: none; } 
a:hover, a:active { text-decoration: none; } 

xem minh họa: - http://jsfiddle.net/zSWbD/7/

1

BỎ DEFAULT LINK SOLVED rằng: điều thăm là css .... bạn chỉ cần đi tới HTML và thêm một đơn giản

< a href = "" style = "text-decoration: none"> </a>

... đó là cách các trang html được sử dụng là

Các vấn đề liên quan