【问题标题】:Opera ignoring float:left;歌剧忽略浮动:左;
【发布时间】:2013-01-01 06:52:54
【问题描述】:

我遇到了问题:<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>";

【问题讨论】:

  • Opera 是否将其视为float:none?可以分享链接或截图吗?

标签: css css-float opera


【解决方案1】:

通过将 float : left 赋予 div navbar_content 来尝试

【讨论】:

    【解决方案2】:

    试试下面的代码。

    可能对你有帮助..

    '显示:内联块'

    【讨论】:

      【解决方案3】:

      我想通了,由于某种原因,Opera 一直将我的 font-size 设置为 0px,而没有另行声明,所以我不得不设置 font-size:1px;在不需要或明确设置字体大小的地方......

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2010-11-13
        • 1970-01-01
        • 1970-01-01
        • 2018-09-15
        • 1970-01-01
        • 2013-02-10
        • 2016-12-13
        相关资源
        最近更新 更多