2013-02-25 180 views

回答

0

我已经做了以下修改:

来源:

.children { 
      display: none; 
      width: 560px; 
      min-height: 30px; 
      position: absolute; 
      left: -244px; 
      top: 48px; 
      text-align: left; 
      background-color: #c7c7c7; 
     } 
.children li { 
      position: relative; 
      float: left; 
      margin-left: 20px; 
     } 

要:

.children{ 
      display: none; 
      min-height: 30px; 
      position: relative; 
      text-align: left; 
      top: 10px; 
     } 
     li:nth-child(3) .children{ 
      right: 252px; 
     } 
     li:last-child .children{ 
      right: 502px; 
     } 
     li:nth-child(3) .children li { 
      position: relative; 
      float: left; 
      width: 628px !important; 
     } 

     li:last-child .children li{ 
      position: relative; 
      float: left; 
      width: 628px !important; 
     } 

看那updated fiddle

+0

这是伟大的,但我需要的是为'子''ul'为全宽(与菜单大小相同),而不是父'li'的大小。 – zero 2013-02-25 17:18:57

+0

如果结构必须改变,以实现这也很酷也 – zero 2013-02-25 17:26:34

+0

Ooooh,明白了......你的意思是像[这](http://jsfiddle.net/hkpy5/2/)? – 2013-02-25 17:49:38