-6
我想在悬停时创建具有延迟效果的2级导航。创建2级导航栏
in css放在哪里
transition
?
这里是代码片段:
@import url('https://fonts.googleapis.com/css?family=Quicksand&subset=latin-ext');
body {
background: #ADAEAE;
box-sizing: border-box;
color: white;
font-family: 'Quicksand';
margin: 0;
}
nav {
background: #222122;
width: 100%;
text-align: center;
position: fixed;
}
nav ul {
padding: 0;
margin: 0;
list-style: none;
}
nav ul li {
display: inline-block;
}
nav ul a {
display: inline-block;
height: 50px;
line-height: 50px;
padding: 0 10px;
color: white;
text-decoration: none;
}
nav ul a:hover {
background-color: #404040;
transition: all 1s;
}
nav ul ul li {
display: block;
}
nav li ul {
display: none;
position: absolute;
background: #222122;
}
nav li:hover ul {
display: block;
}
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Dokument bez tytułu</title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<nav>
<ul>
<li><a href="#">About</a>
<ul>
<li><a href="#">About2</a></li>
<li><a href="#">About3</a></li>
<li><a href="#">About4</a></li>
</ul>
</li>
<li><a href="#">Offer</a>
<ul>
<li><a href="#">Offer2</a></li>
<li><a href="#">Offer3</a></li>
<li><a href="#">Offer4</a></li>
</ul>
</li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</body>
</html>
请添加你想要的一些图片,包括你的代码已经有 –
OK,我appologise是计算器上的第一篇文章。 –
好吧,你想要什么延迟? –