django 我的卡片大小不一样,我该如何解决?[关闭]

5f0d552i  于 2023-04-13  发布在  Go
关注(0)|答案(1)|浏览(110)

已关闭,该问题需要details or clarity,目前不接受回答。
**想要改进此问题?**通过editing this post添加详细信息并澄清问题。

2天前关闭。
Improve this question

{% extends 'shop/layouts/main.html' %}

{% block title %}
Ar Choose | Register
{% endblock title %}

{% block content %}
        
        <section class="py-5 text-center container" style="margin-top: 70px;">
            <div class="row py-lg-5">
                <div class="col-lg-6 col-md-8 mx-auto">
                    <h1 class="fw-light">AR Choose</h1>
                    <p class="lead text-muted">Our Sales are Coming Soon....</p>
                    <p>
                        <a href="#" class="btn btn-primary my-2">Already User</a>
                        <a href="#" class="btn btn-secondary my-2">New User</a>
                    </p>
                </div>
            </div>
        </section>

        <section class="bg-light py-4 my-5">
            <div class="container">
                <div class="row">
                    <div class="col-12">
                        <h4 class="mb-3">Categories</h4>
                        <hr style="border-color: brown;">
                    </div>

                    {% for item in catagory %}
                    <div class="col-md-4 col-lg-3">
                        <div class="card my-3 ">
                            <img src="{{item.image.url}}" class="card-image-top" alt="Categories">
                            <a href="#">
                            <div class="card-body">
                                <h5 class="card-title text-primary">{{ item.name }}</h5>
                                <p class="card-text">{{item.description}}</p>
                            </div></a>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>

        </section>

我应该如何更改代码以使我的卡片大小相同?

rks48beu

rks48beu1#

我想你需要像这样的产品图片和产品说明的设置大小...

<div class="col-md-4 col-lg-3">
    <div class="card my-3 ">
        <img src="{{item.image.url}}" style="height: 100px;" class="card-image-top" alt="Categories">
        <a href="#">
        <div class="card-body">
            <h5 class="card-title text-primary">{{ item.name }}</h5>
            <p class="card-text">{{item.description|truncatewords:5}}</p>
        </div></a>
    </div>
</div>

相关问题