100% width divs not spanning entire width of the browser in webkit

前端 未结 8 1017
南方客
南方客 2021-01-08 01:10

I\'m having a hard time with what I thought would be a dead simple issue.

I\'m trying to create a div that spans 100% of the width of a browser window. The div is f

8条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-08 01:24

    I fixed by using display: table-cell

    #field {
        width: 100%;
        background: #009900;
        height: 100px;
        margin: 0;
        margin-bottom: 25px;
        padding: 0;
        display: table;
    }    
    
    .singleyard {
        width: 1%;
        margin: 0;
        padding: 0;
        background: #090;
        display: table-cell;
    }
    
    .fiveyards {
        width: 5%;
        margin: 0;
        padding: 0;
        display: table-cell;
    }
    

提交回复
热议问题