Centering floating divs within another div

前端 未结 7 2117
自闭症患者
自闭症患者 2020-11-29 14:58

I\'ve searched other questions and, while this problem seems similar to a couple of others, nothing I\'ve seen so far seems to address the issue that I\'m having.

I

7条回答
  •  我在风中等你
    2020-11-29 15:58

    display: inline-block; won't work in any of IE browsers. Here is what I used.

    // change the width of #boxContainer to 
    // 1-2 pixels higher than total width of the boxes inside:
    
    #boxContainer {         
        width: 800px; 
        height: auto;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
    
    #Box{
        width: 240px; 
        height: 90px;
        background-color: #FFF;
        float: left;
        margin-left: 10px;
        margin-right: 10px;
    }
    

提交回复
热议问题