gpt4 book ai didi

html - Bootstrap v4-Alpha 6 | .float-lg-right 不工作

转载 作者:太空宇宙 更新时间:2023-11-04 13:51:14 26 4
gpt4 key购买 nike

我正在尝试创建一个 Bootstrap 网站,菜单导航内容向右对齐,使用 .float-lg-right(正式名称为 .pull-lg-right)。问题是 ul 仍然向左对齐。有趣的是,使用 .float-md-right,内容在折叠菜单中右对齐。

<!DOCTYPE html>
<html lang="en">
<head>
<!-- META DATA -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>TEXT</title>
<!-- CSS & ASSETS-->
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-toggleable-md mb-4">
<div class="container">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#">TEST</a>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto float-lg-right">
<li class="nav-item">
<a class="navlink" href="#">TEXT</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- SCRIPTS -->
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"
integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n"
crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"
integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb"
crossorigin="anonymous"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>

最佳答案

对于 float-*-right use ml-auto

对于 float-*-left use mr-auto

关于html - Bootstrap v4-Alpha 6 | .float-lg-right 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41647229/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com