我在我的html代码中使用了Ujquery的自动菜单。 该网站为here
我在我的css文件中管理了以下代码调整它的宽度:
.menu{
position: absolute;
top: 5%;
left: 10%;
width: 80%;
background-color: blue;
}
为什么宽度参数效果很好而高度不高?我想将所有这些菜单设置为可用空间的50%。 感谢您提前的时间。
答案 0 :(得分:1)
.ui-accordion-content{height:50%;position:relative;}
根本不要初始化heightStyle。
$(function() {
$( "#accordion" ).accordion({
});
});
答案 1 :(得分:1)
如果您只是想让手风琴在页面上填充一定的空间。试试这个 -
http://jsfiddle.net/apaul34208/GxVYN/1/
JS
$(function () {
$("#accordion").accordion({
heightStyle: "fill"
});
});
CSS
body {
height:500px;
}
.container {
height:50%;
}
答案 2 :(得分:0)