好的,所以我在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