希望有一个标题,副标题,然后在最后的第三部分中,两个框紧挨在一起。
努力让两个按钮在彼此相邻的中心对齐。在某些宽度上看起来不错,但在整个宽度上流动到下一行

        <div class="button-box">
        <div class="myoffer3 col-lg-6">
                <a href="mylink.php" class="btn btn-info" role="button">About Us</a>
            </div>
        <div class="myoffer4 col-lg-6">
                <a href="mylink.php" class="btn btn-info" role="button">Our Products</a>
            </div>
        </div>
    </div>

我的CSS
.myoffer3 {
display: inline;
padding:20px;
}
.myoffer4 {
 display: inline;
 padding: 0 20px;

 }
 .button-box {
  width:100%;
  text-align:center;
 }

最佳答案

我已经知道你的意思了。
这是正确的修复方法。
HTML格式

  <div class="button-box col-lg-12">
            <a href="mylink.php" class="btn btn-info" role="button">About Us</a>
            <a href="mylink.php" class="btn btn-info" role="button">Our Products</a>
   </div>

CSS
.button-box {
   text-align:center;
   margin-top:20px;
}

DEMO

关于html - 在Bootstrap Div中将2个按钮彼此相邻放置,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33233102/

10-16 12:42