1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > html下拉框里怎么打出间距 CSS下拉菜单间距

html下拉框里怎么打出间距 CSS下拉菜单间距

时间:2022-07-08 21:25:29

相关推荐

html下拉框里怎么打出间距 CSS下拉菜单间距

我已经成功创建此导航菜单,但菜单项的间距已关闭。同样在次要名单上,由于其中一项,我不得不让它们变宽。有没有办法让宽度根据最长项目的长度而变化。CSS下拉菜单间距

Menu

body {

font-family: "Gill Sans", Calibri, "Trebuchet MS", sans-serif;

}

#nav, #nav ul { /* all lists */

padding: 0;

margin: 0;

list-style: none;

line-height: 1;

}

#nav a {

display: block;

width: 10em;

}

#nav li { /* all list items */

/* The sum of the next two lines creates the nav bar height*/

padding-top:12px;

height: 28px;

float: left;

background: #f15a22;

width: 7em; /* width needed or else Opera goes nuts */

}

#nav li ul { /* second-level lists */

position: absolute;

background: #f15a22;

width: 10em; /* controls width of background colour of second-level list - currently set to width of lon

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。