CSS center content inside div

后端 未结 7 899
离开以前
离开以前 2020-12-23 13:15

I need to center html content inside a div class=\"partners\" (top div with 2 images). As you can see from the image below (it floats left instead of center of the div):

相关标签:
7条回答
  • 2020-12-23 13:55

    Try using flexbox. As an example, the following code shows the CSS for the container div inside which the contents needs to be centered aligned:

    .absolute-center {
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
    
        -ms-flex-align: center;
        -webkit-align-items: center;
        -webkit-box-align: center;
    
        align-items: center;
    
    }
    
    0 讨论(0)
提交回复
热议问题