【发布时间】:2017-07-18 13:21:32
【问题描述】:
我正在尝试进行响应式网页设计,特别是在达到 576 像素的屏幕尺寸时将列容器内的图像居中。我已经尝试过我在其他地方看到的这种说法:
@media(max-width: 576px)
{
.first-pic-container {
float: none;
margin: 0 auto;
}
但这并没有多大作用。我也尝试过使用 Bootstrap 的 offset 类,但这也无济于事。
这是相关的 HTML:
<div class="col-sm-4 first-pic-container">
<img class="first-step" src="step1image.png" alt="firstpic">
<div class= "row">
<div class="col-sm-12 col-md-12 col-lg-10 first-p-container">
<p class="step-one-p"> Enter the classes you are looking to take for next semester! </p>
</div>
</div>
</div>
还有供视觉参考的代码笔。我在firstpic 和first-pic-container 周围添加了我想要居中的边框:https://codepen.io/gkunthara/pen/VWdrYj
【问题讨论】:
标签: html css twitter-bootstrap