jquery - 带有徽标移动的响应式导航栏问题
问题描述
我希望在使用智能手机等设备时徽标移到中间并隐藏登录和注册按钮。
我成功隐藏了按钮,但未能移动徽标。这是代码。
<nav class="px-md-5 p-3 py-lg-3 py-5 bg-dark text-white d-flex flex-row justify-content-between align-items-center">
<div class="d-flex alignment ">
<h1>LOGO</h1>
</div>
<div class="d-flex flex-row align-items-center justify-content-between ">
<a href="" class="btn border-white text-white mr-3 d-sm-none d-none d-md-none d-lg-block font_login">LOGIN</a>
<a href="" class="btn border-white text-white d-sm-none d-none d-md-none d-lg-block">Register</a>
</div>
</nav>
解决方案
看看下面的使用媒体查询对于某些设备宽度,你可以实现这一点。
@media only screen and (max-width: 600px) {
.d-flex {
width: 100%;
text-align: center;
}
}
<nav class="px-md-5 p-3 py-lg-3 py-5 bg-dark text-white d-flex flex-row justify-content-between align-items-center">
<div class="d-flex alignment ">
<h1>LOGO</h1>
</div>
<div class="d-flex flex-row align-items-center justify-content-between ">
<a href="" class="btn border-white text-white mr-3 d-sm-none d-none d-md-none d-lg-block font_login">LOGIN</a>
<a href="" class="btn border-white text-white d-sm-none d-none d-md-none d-lg-block">Register</a>
</div>
</nav>
推荐阅读
- jquery - 在 HTML 中图像的右侧插入一个包含 2 行 4 列的表格
- xamarin.forms - XamarinForms Shell 导航与上一页的 TabBar 项
- youtube-livestreaming-api - 创建默认广播的问题(POST https://www.googleapis.com/youtube/v3/liveBroadcasts)
- php - android studio添加记录和更新问题
- javascript - Form 的 App Script 无法准确替换模板中的字段
- mysql - 用事务处理 findAll 查询并使用限制和抵消它的不工作
- json - 将 json 数据从烧瓶 api 解析到颤振列表
- ios - 在已失效的会话中创建的任务
- git - git 在拉取请求之前与上游同步分叉历史
- informatica - 如何从 informatica 云调用 teradata 上的存储过程/宏?