我對css不太瞭解,但是我被卡住了。我想在懸停時將字體的顏色更改爲淡藍色。但是,我希望默認顏色是白色的......我該怎麼做?我所現在,已經改變了默認的文本紫..並強調:S它確實改變字體爲藍色,雖然,在懸停..將鼠標懸停在文本上更改字體顏色
代碼:
CSS:
a:hover
{
text-decoration:none;
color: #B9D3EE;
}
.navigationBar
{
background: gray;
height: 50px;
width: 100%;
}
.menuOption
{
width:143px;
text-align: center;
position: static;
float:left;
}
#search
{
position:relative;
font-weight: bold;
color: white;
height: 27px;
margin-left: 23px;
left: 133px;
top: -17px;
margin-top: 1px;
}
#reports
{
position:relative;
font-weight: bold;
color: white;
height: 27px;
margin-left: 23px;
left: 34px;
top: -16px;
margin-top: 1px;
}
#addProject
{
position:relative;
font-weight: bold;
color: #B9D3EE;
height: 27px;
margin-left: 23px;
left: -542px;
top: -18px;
margin-top: 1px;
}
#editProject
{
position:relative;
font-weight: bold;
color: white;
height: 27px;
margin-left: 23px;
left: -611px;
top: -18px;
margin-top: 1px;
}
#more
{
position:relative;
font-weight: bold;
color: white;
height: 27px;
margin-left: 23px;
left: -66px;
top: -15px;
margin-top: 1px;
}
HTML:
<div class = "navigationBar">
<asp:ImageButton ID="ImageButton1" runat="server" Height="18px"
ImageUrl="~/g.png" style="margin-left: 1012px; margin-top: 18px"
Width="23px" />
<div id = "search" class = "menuOption" >
<a href=""> Search </a>
</div>
<div id = "reports" class = "menuOption" >
<a href=""> Reports </a>
</div>
<div id = "more" class = "menuOption" >
<a href=""> More... </a>
</div>
<div id = "addProject" class = "menuOption" >
<a href=""> Add Project </a>
</div>
<div id = "editProject" class = "menuOption" >
<a href=""> Edit Project </a>
</div>
</div>
好感謝,認爲工程...但只是出於好奇......哪裏它得到紫色下劃線字體顏色/風格? .. – BigBug 2012-03-22 16:44:21
默認情況下紫色是'visited'鏈接。我再次編輯我的答案,以顯示所有4個psuedo元素。更改每種顏色以查看其效果。 – 2012-03-22 16:45:24
嗯......但紫色是在任何事物被點擊之前發生的......?我也沒有任何「訪問」的代碼在我的CSS ...謝謝你的反應的方式:) – BigBug 2012-03-22 16:46:39