html - 我怎样才能对齐这个?

标签 html css

这是演示:http://jsfiddle.net/KS4eS/

请先看一下演示。

我想将它们的对齐方式设置为相同。

是这样的。我该怎么办?

                    center
------------------------------------------------------
                    A2345343
                    B435234
                    C4364353
                    D3426432632
                    E46324362
                    F235235
                    GGGGG

------------------------------------------------------

HTML

<div class='general'>

    <div class='list'>

            <div class="top_page_function">A2345343</div>
            <div class="top_page_function">B435234</div>
            <div class="top_page_function">C4364353</div>
            <div class="top_page_function">D3426432632</div>
            <div class="top_page_function">E46324362</div>
            <div class="top_page_function">F235235</div>
            <div class="top_page_function">GGGGG</div>

    </div>



</div>

CSS

.general {
    background-color: rgb(255, 255, 255);
    border-radius: 8px 8px 8px 8px;
    box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    text-align: center;
    padding: 10px;
}

.list{
    width: 400px;
    min-width: 250px;
    margin-bottom: 20px;
}

最佳答案

这将得到你想要的:

.general {
    background-color: rgb(255, 255, 255);
    border-radius: 8px 8px 8px 8px;
    box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    padding: 10px;
    text-align:center;
}

.list{
    margin-bottom: 20px;
    text-align: left;
    margin: 0 auto;
    display: inline-block;
}

它也适用于任何宽度。看这里:http://jsfiddle.net/KS4eS/8/

关于html - 我怎样才能对齐这个?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14567660/

相关文章:

html - 在网页顶部显示下拉菜单的问题

html - 为带有 image-url 内容的伪元素设置宽度

javascript - 只有在 Safari 中悬停后,垂直对齐的文本才不会立即正确格式化

javascript - 如何为新的 Div 类设置链接和测试颜色和属性

HTML CSS : Broken Table?

CSS 选择器 : Style element left or right from text

javascript - Bootstrap-自动调整div内的字体

html - 使导航折叠

html - float 图像在 IE9 中扭曲无序列表

html - Xpath:查找类包含空格的元素