2013-01-01 52 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;那裏沒有字體大小需要或明確設置...