Floated div, 100% height

后端 未结 3 1935
南方客
南方客 2021-01-07 01:46

t\"enter

***** {

    -webkit-tap-highligh         


        
相关标签:
3条回答
  • 2021-01-07 01:58

    Why dont you use clear:both?

    <div id="footer-gradient">
       ...
       <div class="clear"></div>             <!---- Inside footer-gradient div. -->
    </div>
    

    Css:

    .clear{ clear:both; }
    
    0 讨论(0)
  • 2021-01-07 01:59

    Like this

    demo

    css

        .footer{
       display:table;
        width:100%;
    }
    .col1{
        background-color:red;
        display:table-cell;
    }
    .col2{
        background-color:red;
        display:table-cell;
        padding:0 10px;
    }
    .col3{
        background-color:red;
        display:table-cell;
    }
    
    0 讨论(0)
  • 2021-01-07 02:00
    1. Set the three elements' container (#footer-gradient) display: table
    2. And set the elements themselves (.col) display: table-cell
    3. Remove the floating.
    4. Success.

    #footer-gradient {
        display: table;
    }
    #footer-gradient .col {
        display: table-cell;
        float: none;
    }
    
    0 讨论(0)
提交回复
热议问题