好的,所以我在CSS中獲得轉換以解決我希望他們如何工作的問題有兩個問題,並且我希望有一些具有CSS經驗的人員向我展示如何實現我想實現。CSS轉換 - 問題
我得到的實際初始轉換工作正常,但我在這裏有兩個問題。
首先,我的導航欄的第二個按鈕/鏈接 - 字符 - 有三個子鏈接,當字符按鈕懸停時顯示。我想獲得它,以便這些子鏈接不會顯示,直到發生字符按鈕的實際轉換。我希望你明白我的意思。那麼,這是可能的,如果是這樣,怎麼樣?其次,現在我所有的地方都是按鈕/鏈接翻轉時的轉換,但是當它們被轉出時沒有任何轉換。相反,在推出時它會立即回到默認狀態,而且我感覺真的會破壞過渡效果。所以,我想知道是否有可能以設置懸停出來的過渡,以及在懸停
這裏是我的HTML代碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home</title>
<link rel="stylesheet" href="complex_1.css"/>
</head>
<body>
<ul id="navbar">
<li id="home"><a href="#">Home</a></li>
<li id="characters"><a href="#">Characters</a>
<ul>
<li id="subzero"><a href="#">Sub-Zero</a></li>
<li id="scorpion"><a href="#">Scorpion</a></li>
<li id="kano"><a href="#">Kano</a></li>
</ul>
</li>
<li id="about"><a href="#">About</a></li>
<li id="contact"><a href="#">Contact</a></li>
</ul>
</body>
</html>
而且有問題的CSS代碼它:
ul { /* Sets out the dimensions of the unordered list. */
font-family:Verdana;
font-size: 17px;
margin: 0px;
padding: 0px;
list-style:none;
position:absolute;
letter-spacing:1px;
}
ul li { /* All list items of unordered lists. */
display: block;
position: relative;
text-align:center;
float: left; /* Makes the navigation bar horizontal instead of vertical. */
}
li ul {
display: none; /* Hides the dropdown menu list items by default. */
}
ul li a { /* All list items of unordered lists that are links. */
color: #ffffff;
background: #000000;
display:block;
text-decoration: none;
border-top: 1px solid #ffffff;
padding: 7px 40px 7px 40px;
margin-left: 0px;
white-space: nowrap;
}
ul li a:hover {
-moz-transition-property:background-color;
-moz-transition-duration:400ms;
-moz-transition-timing-function:ease-in-out;
color:#ffffff;
background: #ff0000;
}
li:hover ul {
display:block;
width:182px;
}
li:hover li {
display:block;
font-size:10px;
float:none;
}
li:hover a {
background: #000000; /* This is where you apply the colour you want for the dropdown list items off the main menu. */
}
li:hover li a:hover {
color: #ffffff;
background: #ff0000; /* This is where you apply the colour you want for the hover over the list. */
}
在此先感謝任何人誰可以幫助我在這裏我想做什麼,它真的非常感激。
還記得我們回答你的問題嗎? – sheriffderek
哈哈,對不起,在最好的時候我沒有最好的注意力,最重要的是回到大學。 – Hashim