当我的浏览器处于最大尺寸时,我创建了一个看起来很好的菜单栏但是,当我将其缩小时,我的菜单栏无法相应地调整其大小。 这是我的css代码
#dropdown ul{
margin:0;
padding:0;
/*width:63%; */
height:31px;
list-style-type: none;
/*background:black;*/
position:absolute;
}
#dropdown ul li {
width: 128.83px;
text-align: center;
line-height: 21px;
float:left;
position:relative;
border:1px solid;
}
#dropdown li ul {
display:none;
}
#dropdown li:hover ul {
display:block;
position:absolute;
}
#dropdown ul li a{
display: block;
padding: 5px;
background: skyblue;
text-decoration: none;
}
#dropdown ul li a:hover{
color: #fff;
background: #939393;
}
<div id="dropdown">
<ul>
<li><a href="index.html"> Home </a></li>
<li>
<a href="admission.html"> Admission ▾</a>
<ul>
<li> <a href="admission.html"> Fee Structure </a></li>
<li><a href="merit.html"> Merit List </a></li>
</ul>
</li>
<li><a href="faculty.html"> Faculty </a></li>
<li><a href="gallery.html"> Photo Gallery</a></li>
<li><a href="academic.html"> Academic ▾</a>
<ul>
<li> <a href="academic.html#bscs"> BS(CS) </a></li>
<li> <a href="academic.html#bsit"> BS(IT) </a></li>
<li><a href="academic.html#mcs"> MCS </a></li>
<li><a href="academic.html#mit"> MIT </a></li>
</ul>
</li>
<li><a href="contact.html"> Contact us </a></li>
</ul>
</div>
答案 0 :(得分:0)