【问题标题】:Horizontally Align Tworesponsive Images水平对齐两个响应图像
【发布时间】:2015-06-25 22:35:54
【问题描述】:

仍在学习响应式网页设计并遇到了障碍。

有没有一种方法可以让这两个链接的图像水平对齐,而不是相互重叠,同时仍然保持响应能力? 基本上我需要这些图像水平地在同一条线上,同时仍然具有响应性。

每个图像最好有两个 div 标签?还是一个 div 中有两个图像?我不确定。

你可以看到我在用jsfiddle做什么。

#header {
padding-top: 1%;
padding-bottom: .5%;
background-color: white;
}
#header img {
display: block;
margin-left: auto;
margin-right: auto;
height: 20%;
width: 20%;
}

【问题讨论】:

    标签: html css image responsive-design


    【解决方案1】:

    这是小提琴:https://jsfiddle.net/odw3vru8/8/

    添加:

    #header {
        /* If you want to center align the images horizontally */
        text-align:center
    }
    
    #header img {
        display: inline-block;
        vertical-align:middle;
    }
    

    【讨论】:

      猜你喜欢
      • 2014-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多