首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Bootstrap4:将卡片并排放置?

Bootstrap4:将卡片并排放置?
EN

Stack Overflow用户
提问于 2018-05-24 12:48:16
回答 1查看 12.6K关注 0票数 4

所以我使用了bootstrap4。我试着把一张卡片放在另外两张堆叠在一起的卡片的左边,最左边的一张卡片的长度是另外两张cards....But的总长度,我不知道怎么做。

代码语言:javascript
复制
<div class="card w-20">
    <blockquote class="blockquote card-body">
        <p>This card on the left of the other two cards, with a fixed height and scrolling.</p>
        <footer class="blockquote-footer">
            <small class="text-muted">
                Someone famous in <cite title="Source Title">Source Title</cite>
            </small>
        </footer>
    </blockquote>
</div>
<div class="card w-75">
    <div class="card-body">
        <h5 class="card-title">How do you want to ask the question?</h5>
        <p class="card-text">Enter the information below.</p>
        <div class="input-group">
            <div class="input-group-prepend">
                <span class="input-group-text">Description</span>
            </div>
            <textarea class="form-control" aria-label="With textarea"></textarea>
        </div>
        <div class="input-group">
            <div class="input-group-prepend">
                <span class="input-group-text">Supplemental Methods</span>
            </div>
            <button type="button" class="btn btn-outline-dark m-3">Text</button>
            <button type="button" class="btn btn-outline-dark m-3">Audio</button>
            <button type="button" class="btn btn-outline-dark m-3">Video</button>
            <button type="button" class="btn btn-outline-dark m-3">Image</button>						 
        </div>
        <button type="button" class="btn btn-outline-dark m-3 float-right">Next</button>						 
    </div>
</div>
<div class="card w-75">
    <div class="card-body">
        <h5 class="card-title">How should students ask the question?</h5>
        <p class="card-text">Enter the information below.</p>
        <div class="input-group text-center">
            <button type="button" class="btn btn-outline-dark m-3">Audio</button>
            <button type="button" class="btn btn-outline-dark m-3">Video</button>
            <button type="button" class="btn btn-outline-dark m-3">Short Answer</button>
            <button type="button" class="btn btn-outline-dark m-3">Sorting</button>						 
        </div>
        <div class="input-group mx-auto">
            <button type="button" class="btn btn-outline-dark m-3">T/F</button>
            <button type="button" class="btn btn-outline-dark m-3">Matching</button>
            <button type="button" class="btn btn-outline-dark m-3">Label</button>
            <button type="button" class="btn btn-outline-dark m-3">Multiple Choice</button>						 
        </div>
        <button type="button" class="btn btn-outline-dark m-3 float-right">Next</button>					
    </div>
</div>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-05-24 13:19:21

对于这种布局,您应该使用网格,而不是实用程序类:

代码语言:javascript
复制
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<div class="container">
    <div class="row">
        <div class="col col-md-3">
            <div class="card h-100">
                <p class="card-body">This card on the left of the other two cards, with a fixed height and scrolling.</p>
            </div>
        </div>
        <div class="col col-md-9">
            <div class="card">
                <p class="card-body">How do you want to ask the question?<p>
            </div>
            <div class="card">
                <p class="card-body">How should students ask the question?</p>
            </div>
        </div>
    </div>
</div>

票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50501186

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档