bootstrap - 同一行 <H> 和按钮

我想在同一行有一个和一个按钮。在 float:left 上并在 上按钮float:right。因此,一个在一侧,另一个在另一侧的相同位置。


<div class="row">

  <div>

    <h3>Catalogue</h3>

    <div>

      <a href="search.php" class="btn btn-primary"><i class="fa fa-search"></i></a>

    </div>

  </div>

</div>

这是我到目前为止的代码。我正在使用引导程序3。


慕勒3428872
浏览 131回答 2
2回答

蛊毒传说

这将解决您的疑问。<!DOCTYPE html><html><head>&nbsp; <title>Bootstrap Example</title>&nbsp; <meta charset="utf-8">&nbsp; <meta name="viewport" content="width=device-width, initial-scale=1">&nbsp; <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"></head><body><div class="container">&nbsp; <div class="row">&nbsp; &nbsp; <div class="col-sm-6">&nbsp; &nbsp; &nbsp; <h3>Catalogue</h3>&nbsp; &nbsp; </div>&nbsp; &nbsp; <div class="col-sm-6">&nbsp; &nbsp; &nbsp; <div class="pull-right">&nbsp; &nbsp; &nbsp; &nbsp;<a href="search.php" class="btn btn-primary">Click Me<i class="fa fa-search"></i></a>&nbsp; &nbsp; &nbsp; </div>&nbsp; &nbsp; </div>&nbsp; </div></div></body></html>

红颜莎娜

这是您要找的吗?↓↓<!DOCTYPE html><html><head>&nbsp; <title>Bootstrap Example</title>&nbsp; <meta charset="utf-8">&nbsp; <meta name="viewport" content="width=device-width, initial-scale=1">&nbsp; <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"></head><body>&nbsp; <div class="container">&nbsp; &nbsp; <h3>Catalogue&nbsp; &nbsp; &nbsp; <a href="search.php" class="btn btn-primary pull-right">Click Me<i class="fa fa-search"></i></a>&nbsp; &nbsp; </h3>&nbsp; </div></body></html>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5