代码之家  ›  专栏  ›  技术社区  ›  Gilles Heinesch buninadev

所有按钮都应该在每张卡片的按钮上[副本]

  •  0
  • Gilles Heinesch buninadev  · 技术社区  · 7 年前

    我想问我怎么做纽扣 Get LenoxBot Dashboard 因为他们现在有不同的高度。

    How it looks currently

    我当前正在使用此代码:

    <div class="card mt-3 serverscard" style="width: 25rem; margin-bottom: 20px;">
                            <figure style="margin: 20px 60px;">
                                {{#if lenoxbot}} {{#if icon}}
                                <a href="dashboard/{{id}}/overview">
                                    <img id="icon-selectserver" class="card-img-top img-fluid" src="https://cdn.discordapp.com/icons/{{id}}/{{icon}}.jpg" height="120"
                                        width="50">
                                </a>
                                {{else}}
                                <a href="dashboard/{{id}}/overview">
                                    <img id="icon-selectserver" class="card-img-top img-fluid" src="discordicon.png" height="120" width="120">
                                </a>
                                {{/if}} {{else}} {{#if icon}}
                                <a href="https://lenoxbot.com/invite">
                                    <img id="icon-selectserver" class="card-img-top img-fluid" src="https://cdn.discordapp.com/icons/{{id}}/{{icon}}.jpg" height="120"
                                        width="120">
                                </a>
                                {{else}}
                                <a href="https://lenoxbot.com/invite">
                                    <img id="icon-selectserver" class="card-img-top img-fluid" src="discordicon.png" height="120" width="120">
                                </a>
                                {{/if}} {{/if}}
                            </figure>
                            <div class="text card-body" style="margin: 0 20px;">
                                <h3 class="text h5 card-title" style="margin-top: 10px; margin-bottom: 10px; font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;">{{name}}</h3>
                                {{#if lenoxbot}}
                                <h6 class="text h6 card-text" style="margin-top: 10px; margin-bottom: 10px; color:rgb(28, 119, 0);">{{memberscount}} members</h6>
                                <a href="dashboard/{{id}}/overview">
                                    <p class="btn btn-primary btn-lg" style="margin-top: 10px; margin-bottom: 10px;">Dashboard</p>
                                </a>
                                {{else}}
                                <h6 class="text h6" style="margin-top: 10px; margin-bottom: 10px; color:rgb(221, 56, 56);">Not using LenoxBot</h6>
                                <a href="https://lenoxbot.com/invite" target="blanc">
                                    <p class="text text-white button btn btn-warning btn-lg" style="margin-top: 10px; margin-bottom: 10px;">Get LenoxBot!</p>
                                </a>
                                {{/if}}
                            </div>
                        </div>
    

    谢谢您!

    1 回复  |  直到 7 年前
        1
  •  1
  •   Shuvo    7 年前

    为您的 .card 元素:

    .card {
       display: flex;
       flex-direction: column;
    }
    

    对于您的按钮,将一个类添加到 <a> 元素并添加以下css:

    .card-button {
       margin-top: auto;
    }
    

    希望对你有用。。