Html 导航条宽度/CSS
没有javascript,Html 导航条宽度/CSS,html,css,Html,Css,没有javascript,menu\u sub\u a如何继承menu\u li宽度和高度?我试图在菜单子菜单上使用继承类,但没有成功 HTML: 由于菜单子菜单a在菜单子菜单a中,您可以将宽度:100%和高度100%添加到菜单子菜单a,因为这是包含div的百分比。。菜单子菜单应相对定位,并且菜单子菜单ul应具有宽度:100%: ul.menu_sub_ul { list-style-type: none; position: absolute; top: 58px;
menu\u sub\u a
如何继承menu\u li
宽度和高度?我试图在菜单子菜单上使用继承
类,但没有成功
HTML:
由于菜单子菜单a
在菜单子菜单a
中,您可以将宽度:100%和高度100%添加到菜单子菜单a
,因为这是包含div的百分比。。菜单子菜单应相对定位,并且菜单子菜单ul
应具有宽度:100%
:
ul.menu_sub_ul {
list-style-type: none;
position: absolute;
top: 58px;
left: 0;
width: 100%;
}
演示:
li.menu_li {
display: inline;
float: right;
width: auto;
height: auto;
}
a.menu_a, a.menu_drop_a {
display: block;
width: auto;
height: auto;
text-decoration: none;
font-family: Century Gothic,sans-serif;
font-size: 22px;
color: #787878;
background-color: #3A3A3A;
padding: 0.7em 0.95em;
border-right: 1px solid #323232;
}
ul.menu_sub_ul {
list-style-type: none;
position: absolute;
top: 58px;
}
a.menu_sub_a {
width: 100%;
height: 100%;
display: none;
line-height: 50px;
text-align: center;
text-decoration: none;
font-family: Century Gothic,sans-serif;
font-size: 22px;
color: #787878;
background-color: #323232;
border-top: 1px solid #787878;
}
ul.menu_sub_ul {
list-style-type: none;
position: absolute;
top: 58px;
left: 0;
width: 100%;
}