如何将特色图像缩小一点,使其与标题对齐?这是网页AnyGeeks
这是设置图像的代码。
<div class="container">
<div class="jumbotron jumbotron-fluid mb-3 pl-0 pt-0 pb-0 bg-white position-relative">
<div class="h-100 tofront">
<div class="row justify-content-between">
<div class="col-md-6 pt-6 pb-6 pr-6 align-self-center">
<p class="text-uppercase font-weight-bold">
<a class="text-danger" href="./category.html">{% block category %}{% endblock %}</a>
</p>
<h1 class="display-4 secondfont mb-3 font-weight-bold">{% block ptitle %} {% endblock %}</h1>
<p class="mb-3">
{% block desc %} {% endblock %}
</p>
<div class="d-flex align-items-center">
<img class="rounded-circle" src="{{url_for('static',filename='img/avatar.jpeg')}}" width="70">
<small class="ml-2">RahulVk<span class="text-muted d-block">{% block dtt %}{% endblock %}read</span>
</small>
</div>
</div>
<div class="col-md-6 pr-0">
<img src="{% block featuredImage %}{% endblock %}">
</div>
</div>
</div>
</div>
我使用烧瓶作为后端。这就是为什么标签在那里。
我建议您在div中添加display flex,并将项目居中对齐:
<div class="col-md-6 pr-0 d-flex align-items-center">
<img src="{% block featuredImage %}{% endblock %}">
</div>
或者你可以添加一些填充顶部:
<div class="col-md-6 pr-0 pt-4">
<img src="{% block featuredImage %}{% endblock %}">
</div>
我建议您在.row
类中添加align-items-center
类。正如@flpfar所建议的,您可以添加col-md-6
类,它将100%工作,但这不是直接的。
<div class="row justify-content-between align-items-center"></div>