簡體   English   中英

html中的文字顏色不變

[英]text color not changing in html

在下面的代碼中,顏色為黑色,但顯示為白色。

主頁|服務

這些顏色的文本顯示為白色,但我給出了黑色。 我在哪里弄錯了?

 #locations { width: 1050px; margin: 0 auto 0 auto; } #locations h1 { margin: 0 auto 0 auto; color: black; font-size: 25px; padding-top: 10px; padding-bottom: 10px; } #locations1 table { width: 1050px; height: 200px; color: white; } .hospitails { background-color: #A52A2A; font-size: 20px; } .hospitails_loc ul { width: 1050px; margin: 1px auto 0 auto; height: 50px; float: relative; color: black; } .hospitails_loc ul li { position: relative; list-style-type: none; display: inline; color: black; } .hospitails_loc li:before { content: " | "; } .hospitails_loc li:first-child:before { content: none; } 
 <div id="locations"> <h1>Locations</h1> <locations1> <table cellpadding="0" cellspacing="0" border="0"> <tr class="hospitails"> <td>Hospitails</td> <td>Clinics</td> <td>Home Care</td> <td>Information Centers</td> </tr> </table> <div class="hospitails_loc"> <ul> <li><a href="#">Home</a> </li> <li><a href="#">About</a> </li> <li><a href="#">Service</a> </li> </ul> </div> <locations1> </div> 

因為#locations1 table選擇器說它是白色的?

不知何故我不明白這個問題,但我看到了一個問題和解決方案。 您正在使用某種自定義標記<locations1> ,它應該更像<div id="locations1">

您的代碼: http : //jsfiddle.net/8e3tcut9/

修改: http : //jsfiddle.net/8e3tcut9/1/

默認情況下,鏈接將在所有瀏覽器中顯示為:

未訪問的鏈接帶有下划線和藍色,已訪問的鏈接帶有下划線和紫色,活動的鏈接帶有下划線和紅色。您可以使用以下樣式更改默認值:

添加此CSS:

.hospitails_loc ul li a{color:black;}

小提琴

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM