Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 居中左浮动内容推特引导_Css_Twitter Bootstrap - Fatal编程技术网

Css 居中左浮动内容推特引导

Css 居中左浮动内容推特引导,css,twitter-bootstrap,Css,Twitter Bootstrap,我对twitter引导世界和基于%的宽度还比较陌生,我对应该很容易完成的事情感到非常困惑 我正在尝试将页面上每个左浮动的.subimg居中。显然,margin:0 auto不起作用,因为它不是静态网格。我在父div上使用了文本对齐中心,但没有任何效果。我的标记如下: <style> .subimg{float:left;} .row-fluid{text-align:center;} </style> <div class="row-fluid"><!

我对twitter引导世界和基于%的宽度还比较陌生,我对应该很容易完成的事情感到非常困惑

我正在尝试将页面上每个左浮动的
.subimg
居中。显然,
margin:0 auto
不起作用,因为它不是静态网格。我在父div上使用了文本对齐中心,但没有任何效果。我的标记如下:

<style>
.subimg{float:left;}
.row-fluid{text-align:center;}
</style>

<div class="row-fluid"><!-- begin row -->
    <div class="span12 subimgstrip">
            <div class="subimg">
                <a href="#">
                    <img src="/wp-content/themes/wordpress-bootstrap/img/products/infection/1.jpg"/>
                    <h6>Customize Settings</h6>
                </a>
            </div>
            <div class="subimg">
                <a href="#">
                        <img src="/wp-content/themes/wordpress-bootstrap/img/products/infection/2.jpg"/>
                        <h6>Set Specific Criteria</h6>
                </a>
            </div>
            <div class="subimg">
                <a href="#">
                        <img src="/wp-content/themes/wordpress-bootstrap/img/products/infection/3.jpg"/>
                        <h6>Customize Alerts</h6>
                </a>
            </div>
            <div class="subimg">
                <a href="#">
                        <img src="/wp-content/themes/wordpress-bootstrap/img/products/infection/4.jpg"/>
                        <h6>Create Antibiograms</h6>
                </a>
            </div>
            <div class="subimg">
                <a href="#">
                        <img src="/wp-content/themes/wordpress-bootstrap/img/products/infection/5.jpg"/>
                        <h6>Isolate Information</h6>
                </a>
            </div>
        </div>
    </div><!-- end row -->

.subimg{float:left;}
.row流体{文本对齐:居中;}

使用twitter引导将浮动内容置于中心的最佳方法是为浮动项目提供一种
显示方式:内联块
并给父div设置
text align:center

样式,除非知道宽度或父div,否则不能将浮动的内容居中,然后可以应用正确的边距使浮动div显示为居中右侧,刚刚意识到我用浮动将内容移出其设置区域(duhh片刻)
display:inline block
似乎为我解决了这个问题。有什么理由我不应该用它吗?我想不出任何理由