【发布时间】:2018-06-19 09:47:15
【问题描述】:
我试图了解如何阻止断点将“联系人”菜单项向下敲到下一行。这是link to the page。
我想让汉堡出现,而不是在页面小于 1065 像素时将联系人菜单项敲到下一页。
使用更少并设置变量:
变量更少:
@mobile: 800px;
@tablet: 900px;
@desktop: 1300px;
@grid-columns: 12;
@grid-gutter-width: @space;
@grid-float-breakpoint: @mobile;
@grid-float-breakpoint-max: (@grid-float-breakpoint - 1);
HTML 导航
<nav class="container lg nav">
<div class="hamburger-wrap js-toggle-menu">
Menu
<div class="hamburger"></div>
</div>
<a href="/" class="logo fl">{{ site_name }}</a>
<span class="panel">
{{ nav from="/" include_home="false" include_entries="true" exclude_from_navigation:isnt="true" }}
{{ if has_entries }}
<span class="dropdown js-dropdown">
<span class="dropdown-trigger {{ if is_current or is_parent }}active{{ /if }}">{{ tag:nav_title or title }}</span>
<span class="dropdown-content">
<a href="{{ url }}">All</a>
{{ *recursive children* }}
</span>
</span>
{{ else }}
<a {{ if is_current or is_parent }} class="active"{{ /if }} href="{{ page_link or url_link or get:url }}" {{ if target }}target="_blank"{{ /if }}">
{{ tag:nav_title or title }}
</a>
{{ /if }}
{{ /nav }}
</span>
【问题讨论】:
-
你应该给你的导航项一个固定的宽度,以正确计算你的断点。否则你需要 JavaScript 来计算宽度。
标签: html css less breakpoints