0

CSS を使用して UL タグにドロップダウン ホバー リストを作成しましたが、マウスをリンクの上に置く前にそれらが消えてしまいます。どうすればこれを止めることができますか?

これは私のコードです:

#header {
  margin: 0px;
  padding: 0px;
  width: 100%;
  background-color: red;
  height: 30px;
  box-shadow:inset 0 1px rgba(255,255,255,0.3), inset 0 10px rgba(255,255,255,0.2), inset         0 10px 20px rgba(255,255,255,0.25), inset 0 -15px 30px rgba(0,0,0,0.3);
  text-align: center;
}
#header ul {
  margin: 0px;
  padding: 0px;
}
#header ul li {
  display: inline;
  text-align: center;
  position: relative;
}
#header ul li a {
  text-decoration: none;
  font-size: 22px;
  color: white;
  font-weight: bold;
  line-height: 30px;
  margin-left: 10px;
}
#header ul ul {
  position: absolute;
  visibility: hidden;
  top: 31px;
}
#header ul li:hover ul {
  visibility: visible;
}
#header ul li a:hover {
  text-decoration: underline;
  font-size: 22px;
  color: black;
}
4

2 に答える 2

0

追加してみるheight

#header ul li a{
text-decoration:none;
font-size:22px;
color:white;
font-weight:bold;
height:30px;
line-height:30px;
margin-left:10px;
}
于 2013-06-17T15:34:57.413 に答える