English 中文(简体)
CSS - - “让儿童在母体内坐”
原标题:CSS - Firefox - Getting Child elements to sit inside the parent element

所有人,

这里是法典。

#feature_tabs_indicators {
display: block;
height: 14.5px;
background-color: rgb(244,1,87);
}
#feature_tabs_indicators ul {
    display: block;
    height: 14.5px;
    text-align: center;
    padding: 0;
    margin: 0 auto;
}
    #feature_tabs_indicators ul li {
        display: inline;
        width: auto;
        height: 14.5px;
        list-style-type: none;
        background-color: rgb(34,61,166);
        padding: 0 5px;
        margin: 0;
    }

现为超文本:

<div id="feature_tabs_indicators">
        <ul>
            <li id="ind_bt" class="c_ind">.</li>
            <li id="ind_st" class="c_ind">.</li>
            <li id="ind_lc" class="c_ind">.</li>
            <li id="ind_rb" class="c_ind">.</li>
            <li id="ind_lg" class="c_ind">.</li>
        </ul>
    </div>

rel=“nofollow”>Jsfiddle.net<<

Problem: When I run the code in Chrome, IE9, all looks well, i.e. the blue squares in the middle are sitting on the red line (parent). However, when I run this in Firefox, their appears a sit slightly below the parent. You can see the thin red line peeking out on top of the blue squares.

为什么如此,我如何解决这一问题。

最佳回答

上网检查。

 #feature_tabs_indicators ul li {
            display: inline-block;
...
}
问题回答

@salman Khan; give inline-block to your #feature_tabs_indicators ul li .

由于<代码>inline 内容从不垂直margin & pavention ,因此li s不能在母体内。 因此,<代码> 仅采用文本的<代码>hal。

http://www.max Design.com.au/articles/inline/"rel=“nofollow” http://www.max Design.com.au/articles/inline/





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jQuery block moving

I wanna move a div block to the top, so I coded like this: CSS part: .movingPart{ margin-top:80px; } jQuery part: $(document).ready(function() { $( #btn ).click(function() { $( .movingPart )....

Private FireFox plugin

I m looking at getting a FireFox plugin developed - but is it possible to create a plugin that is for private use only, so only those I share it with have it and not open to the masses? Need this for ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Cross-browser development

I m developing a web application for a new service, starting from Firefox 3.5. The interface design is tableless, only using divs + CSS & performance-blessed practices. Now, while being ...

Cross browser way of setting IFrame to "about:blank"?

Does anybody know a proper, cross-browser way to "empty" an IFrame? Is "about:blank" recognized without error across all browsers? Is it valid to give an IFrame an empty src?

热门标签