Adding borders to span divs in Bootstrap messes up layout

后端 未结 5 1678
遇见更好的自我
遇见更好的自我 2021-02-07 13:58

I am starting with Twitter Bootstrap and have a question about how layout functions in it. Here is the HTML:



    
         


        
5条回答
  •  灰色年华
    2021-02-07 14:12

    You may also use negative margins :

    div.span4, div.span8, div.span12
    {
        background-color: #eee;
        border: 1px solid #888;
        border-radius: 3px;
        margin: -1px;
    }
    

    It's not as good a solution as using box-sizing: border-box, IMHO, but it's just worth noticing it works, if you're forced to use box-sizing: content-box.

提交回复
热议问题