【发布时间】:2018-03-03 11:55:16
【问题描述】:
我知道这是一个设置问题,但我是新手,不知道用什么确切的术语来获得我正在寻找的答案。
我在 Django 1.11 上使用 Bootstrap-3.3.7
当我在第一列和第一行插入图像时,我会溢出到第二列。
有图片
没有图像的列可以正常工作。
<div class="tab-content">
<div class="tab-pane active" id="{{vg.grouper.id}}{{fg.grouper.id}}hari_ini">
<div class="row">
{% for sg in show_list2 %}
{% if sg.grouper %}
{% for sh in sg.list %}
<div class="col-xs-3 col-xs-spl col-xs-npr">
<div class="contain">
{% load static %}
{% ifchanged %}
<img src='{% static sh.film.poster %}' width= 100% >
{% endifchanged %}
</div>
</div>
<div class="col-xs-3 col-xs-npl col-xs-npr">
<div class="content">
<ul>
<li>
<p class=p1>{{ sh.show_time_today }}</p>
</li>
</ul>
</div>
</div>
<div class="col-xs-3 col-xs-npl col-xs-npr">
<div class="content">
<ul>
<li>
<p class=p1>{{ sh.rps_price }}</p>
</li>
</ul>
</div>
</div>
<div class="col-xs-3 col-xs-npl col-xs-npr">
<div class="content">
<ul>
<li>
<p class=p1>{{ sh.rps_price }}</p>
</li>
</ul>
</div>
</div>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</div>
我尝试了下面的 css,但没有帮助。
.contain {
height: /* max height you want */
width: 95% /* max width you want */
overflow: hidden;
}
我尝试使用 col3 和 col9 添加一行,并使用 col12 和 col4 col4 col4 添加相应的行,但结果流变得更加混乱。
应用 Astik 的更改后,屏幕看起来更好,没有空行/列。我仍然看到所有列的溢出。此外,右侧的文本填充/对齐也不正确。这是造成问题的原因
p {
}
.p1 {
color: gold;
font-size: 3.8vw;
text-align: center;
line-height: 60%;
margin-top: 5px;
}
ul{
list-style-type: none;
padding-left: 0;
}
li{
list-style-type: none;
}
col-xs-*{
}
.col-xs-npr{
padding-right: 0;
}
.col-xs-npl{
padding-left: 0;
}
.col-xs-smpr{
padding-right: 3px;
}
.col-xs-smpl{
padding-left: 3px;
}
}
【问题讨论】:
-
给出答案,我认为这个案子应该在官方关闭的原因下关闭:这个问题是由一个无法再复制的问题引起的。
标签: python css django python-3.x twitter-bootstrap-3