css下拉菜单问题 [英] css dropdown menu problem
本文介绍了css下拉菜单问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嘿伙计们,
我很难将下拉菜单放在我的页面中央,它总是在左边部分。很抱歉,我只是一个初学者。这是我写的css代码:
Hey guys,
Im having a hard time on putting the dropdown menu in the center of my page, it's always in the left part. Sorry for asking, im just a beginner. Here's the css code i wrote:
body {
}
#default {
margin: auto;
}
#Menu {
margin: auto;
padding: 0;
}
#Menu ul {
margin: 0;
padding: 0;
line-height: 30px;
}
#Menu li {
margin: 0;
padding: 0;
list-style: none;
float:left;
position: relative;
top: 3px;
left: 5px;
height: 30px;
width: 151px;
}
#Menu ul li a {
text-align: center;
font-family: 'Lucida Bright';
text-decoration: none;
height: 30px;
width: 177px;
display: block;
color: black;
}
#Menu ul ul {
position: absolute;
visibility: hidden;
top: 30px;
}
#Menu ul li:hover ul {
visibility: visible;
}
ul#Menu sub li:hover sub1 {
display: block;
}
#footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px;
}
推荐答案
也发布你的代码,而不是很容易找出问题。
Post yout code too, than it would be easy to figure out the problem.
这篇关于css下拉菜单问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文