2013-01-01 51 views
0

我遇到的问题:<div class='navbar_item navbar_item_active font_colaboratelight' id='nav_".$navbarlink_id."_active' style='float:left;color:#ffffff;'>歌剧忽略浮动:左边;

内浮动元素就好了......我一直很努力的一切,但我确定这唯一的办法就是设置一个宽度的浮动元素,这是非常不现实的,因为我不知道他们的内容...

任何想法如何解决这个问题?

echo "<div style='width:960px;height:37px;margin-left:auto;margin-right:auto;'> 
    <div style='height:37px;background:url(/system/images/navbar/background/1.png);position:absolute;left:0px;right:0px;z-index:-1;'></div> 
     <div id='navbar_content' style='line-height:0px;width:960px;'>"; 


      // get navbar shortcuts 
      $links = frontend_getnavbarlinks("sid_".$shop_id,$lang); 

      foreach($links as &$link){ 

       $navbarlink_id = $link['id']; 

       $link_section_arr = explode(':',$link['section']); 
       $sectionlink_type = $link_section_arr[0]; 
       $sectionlink_id = $link_section_arr[1]; 

       if($link_section_arr[0] == 'c'){ 
        $href = "/catalog/".$sectionlink_id."/"; 
       } 

       echo " 
       <a href='".$href."' class='toggle_reconstruct'> 

       <div class='navbar_item navbar_item_active font_colaboratelight' id='nav_".$navbarlink_id."_active' style='float:left;color:#ffffff;'> 
        <div style='float:left;'><img src='/system/images/navbar/background_active/1_left.png'></div> 
        <div style='float:left;background:url(/system/images/navbar/background_active/1_middle.png);background-repeat:repeat-x;height:37px;'> 
         <div style='float:left;color:#E46F7B;font-size:15px;margin-right:6px;margin-left:6px;margin-top:12px;'>".$link['info']['label']."</div> 
        </div> 
        <div style='float:left;'><img src='/system/images/navbar/background_active/1_right.png'></div> 
        <div style='clear:both;'></div> 
       </div> 

       <div class='navbar_item navbar_item_inactive font_colaboratelight nav_btn_".$sectionlink_type.$sectionlink_id."' id='nav_".$navbarlink_id."_inactive' style='float:left;color:#ffffff;'> 
        <input type='text' value='".$link['does_expand']."' class='nav_expand_indicator' style='display:none;'> 
        <input type='text' value='".$navbarlink_id."' class='nav_section_id' style='display:none;'> 
        <input type='text' value='".$sectionlink_id."' class='nav_sectionlink_id' style='display:none;'> 

        <div style='padding-left:10px;padding-right:10px;height:37px;'> 
         <div style='float:left;color:#ffffff;font-size:15px;margin-right:6px;margin-left:6px;margin-top:12px;'>".$link['info']['label']."</div> 
        </div> 
       </div> 

       </a> 
       "; 

      } 



       echo " 
       <div style='clear:both;'></div> 
     </div> 
    </div> 
    <div style='clear:both;'></div> 



    <div id='navbar_expand1'></div>"; 
+0

是否歌剧治疗它像'float:none'?你能分享一个链接或制作截图吗? – Pavlo

回答

0

尝试通过给浮动:左到div navbar_content

+0

尝试过,它保持不变... –

0

下面试试这个代码。

它可能对你有帮助..

“显示:inline-block的”

0

我想通了,对一些歌剧原因保持我的设置字体大小为0px,当未声明,否则,所以我不得不设置font-size:1px;那里没有字体大小需要或明确设置...