Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 导航条宽度/CSS_Html_Css - Fatal编程技术网

Html 导航条宽度/CSS

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;

没有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;
    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%;
}