我使用Bootstrap进行设计,并使用标签作为菜单,我为不同尺寸的设备(lg和xs)制作了两个菜单,每个屏幕尺寸的设备都可以正常工作,但在移动浏览器桌面站点选项中看不到。请帮助。
这是头代码:
<header id="mad-header" class="mad-header header-3">
<div class="mad-pre-header">
<div class="container extra-width">
<div class="mad-header-items hide-mobile">
<div class="col-sm-1">
<a href="#" class="mad-link mad-logo"><img src="public/User/images/logo2.png" alt="" width="75"></a>
</div>
<div class="col-sm-8 hide-mobile">
<div class="mad-quick-links">
<a href="#" class="mad-link blink" target="_blank">COVID-19</a><span> | </span>
<a href="#" class="mad-link">MEDICINES</a> <span> | </span>
<a href="#" class="mad-link">LAB TESTS</a><span> | </span>
<a href="#" class="mad-link">ASK DOCTOR</a><span> | </span>
<a href="#" class="mad-link">AYURVEDA</a>
</div>
</div>
<div class="col-sm-3 col-xs-12 second-menu">
<div class="mad-quick-links">
<a href="#" class="mad-link">Login</a> <span> | </span>
<a href="#" class="mad-link">Sign Up</a><span> | </span>
<a href="#" class="mad-link">Offers</a>
</div>
</div>
</div>
<div class="hide-desktop show-mobile mob-nav">
<div class="row text-center topmenu">
<div class="col-xs-2 logo-mob">
<div class="mobile-logo text-left">
<a href="#" class="mad-link mad-logo"><img src="public/User/images/logo2.png" alt="" width="75"></a>
</div>
</div>
<div class="col-xs-10 second-menu">
<div class="mad-quick-links">
<a href="#" class="mad-link blink" target="_blank">COVID-19</a><span> | </span>
<a href="#" class="mad-link">MEDICINES</a><span> | </span>
<a href="#" class="mad-link">LAB TESTS</a><span> | </span>
<a href="#" class="mad-link">ASK DOCTOR</a><span> | </span>
<a href="#" class="mad-link">AYURVEDA</a>
</div>
</div>
</div>
<div class="row mainmenu text-right">
<div class="col-xs-5 logo-mob" style="width:36%">
</div>
<div class="col-xs-6 none-mob">
<div class="mad-quick-links">
<a href="#" class="mad-link">Login</a> <span> | </span>
<a href="#" class="mad-link">Sign Up</a><span> | </span>
<a href="#" class="mad-link">Offers</a>
</div>
</div>
<div class="col-xs-1 menu-mob">
<nav class="mad-navigation-container text-left d-block d-sm-none show-mobile">
<ul class="mad-navigation mad-navigation--vertical-sm">
<li class="menu-item"><a href="#" class="mad-link blink" target="_blank">COVID-19</a></li>
<li class="menu-item"><a href="#" class="mad-link">MEDICINES</a></li>
<li class="menu-item"><a href="#" class="mad-link">LAB TESTS</a></li>
<li class="menu-item"><a href="#" class="mad-link">ASK DOCTOR</a></li>
<li class="menu-item"><a href="#" class="mad-link">AYURVEDA</a></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
</header>
我用了"hide-mobile"one_answers";hide-desktop"类可以在大屏幕和小屏幕设备中显示标题。
请帮我解决这个问题。提前谢谢。
您可以使用引导类(.d-{breakpoint}-{value} for sm, md, lg, and xl.
)来完成此操作:
<!-- For your mobile section : -->
<div class="mad-header-items hide-mobile d-none d-sm-block">
<!-- For your desktop section : -->
<div class="hide-desktop show-mobile mob-nav d-block d-sm-none">
- 您可以在Bootstrap Doc中找到更多信息。
- 所有的可能性都在这里列出。
- 所有的断点都在这里列出。