我正在尝试并排设置模态按钮。一个是下载链接,一个是镜像。我尝试使用 display: inline-block; 的 css 创建自己的类。但那没有用。如何将它们并排放置?
这是我的模态代码:
<!-- Texturepack Popup Start -->
<div class = "modal fade" id = "texturepack" role = "dialog">
<div class = "modal-dialog">
<div class = "modal-content">
<div class = "modal-header">
<h4>Texture Pack Download</h4>
</div>
<div class = "modal-body">
<center><h3>Download our Custom Texture Pack!</h3></center>
<p class = "tpbutton btn-toolbar">
<a style = "margin: 0 200px; display: inline-block" class = "btn navbar-btn btn-primary pull-center" href = "#" target = "_texturepack">Download</a>
<a style = "margin: 0 300px; display: inline-block" class = "btn navbar-btn btn-default pull-center" href = "#" target = "_texturepack">Mirror</a>
</p>
<!-- Carousel Text Start -->
<div style = "height:15px"></div>
<div style = "border: 2px solid black; width: 500px; margin: 0 auto" id = "textureCarousel" class = "carousel slide">
<ol class = "carousel-indicators" data-ride = "carousel">
<li data-target = "#textureCarousel" data-slide-to = "0" class = "active"></li>
<li data-target = "#textureCarousel" data-slide-to = "1"></li>
<li data-target = "#textureCarousel" data-slide-to = "2"></li>
</ol>
<div class = "carousel-inner">
<div class = "item active">
<img src = "img/a.png" alt = "Beach" class = "img-responsive">
</div>
<div class = "item">
<img src = "img/b.png" alt = "Beach" class = "img-responsive">
</div>
<div class = "item">
<img src = "img/c.png" alt = "Beach" class = "img-responsive">
</div>
</div>
</div>
<!-- Carousel End -->
</div>
<div class = "modal-footer">
<a class = "btn btn-danger" data-dismiss = "modal">Close</a>
</div>
</div>
</div>
</div>
<!-- Texturepack Popup End -->
最佳答案
使用按钮组。
<div class="btn-group">
<a href="#" class="btn btn-primary">Download</a>
<a href="#" class="btn btn-default">Mirror</a>
</div>
关于javascript - 如何并排制作两个 Bootstrap 按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20962483/