首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

UL下的子菜单会自动内联

2012-03-31 
【求助】UL下的子菜单会自动内联?HTML code!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN

【求助】UL下的子菜单会自动内联?

HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> </head> <style>ul {    margin: 0px;    padding: 0px;    background:#333;    width:949px;}ul li{float:left;      display:inline;      list-style:none;      height:30px;      width:100px;}ul li ul{display:block ;}      </style> <div style="width:949;"><ul><li><a href="#"><span>ALL</span></a>    <ul>      <li style="display:block"><a href="#"><span>all</span></a></li>      <li style="display:block"><a href="#"><span>all</span></a></li>      <li style="display:block"><a href="#"><span>all</span></a></li>      <li style="display:block"><a href="#"><span>all</span></a></li>    </ul> </li><li><a href="#"><span>name</span></a></li><li><a href="#"><span>name</span></a></li><li><a href="#"><span>name</span></a></li><li><a href="#"><span>name</span></a></li><li><a href="#"><span>name</span></a></li><li><a href="#"><span>name</span></a></li></ul></div>


[解决办法]
HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> </head> <style>ul.menu {    margin: 0px;    padding: 0px;    background:#333;    width:949px;}ul.menu li{float:left;      display:inline;      list-style:none;      height:30px;      width:100px;}ul.menu li ul{display:block ;}      </style> <div style="width:949;"><ul class="menu"><li><a href="#"><span>ALL</span></a>    <ul>      <li style="display:block"><a href="#"><span>all</span></a></li>      <li style="display:block"><a href="#"><span>all</span></a></li>      <li style="display:block"><a href="#"><span>all</span></a></li>      <li style="display:block"><a href="#"><span>all</span></a></li>    </ul> </li><li><a href="#"><span>name</span></a></li><li><a href="#"><span>name</span></a></li><li><a href="#"><span>name</span></a></li><li><a href="#"><span>name</span></a></li><li><a href="#"><span>name</span></a></li><li><a href="#"><span>name</span></a></li></ul></div> 

热点排行