我正在使用最新的zurb-foundation創業板的Ruby項目。當屏幕寬度足夠小時,我的導航欄應該是響應式的,並顯示帶有3個水平條的菜單。我得到它顯示單詞「菜單」,但不是單槓。菜單展開時,樣式進一步關閉。破碎的Zurb基金會4響應式導航欄菜單圖標
壓縮擴大導航欄: http://d.pr/i/RtoO
我能夠使用我的項目中使用的CSS和JS轉載本文中的jsfiddle(僅jQuery和Zurb基金會的東西現在)。 http://jsfiddle.net/UvL7e/
我的標記錯了嗎?我還沒有任何自定義CSS的導航欄,並沒有使用任何其他的CSS庫。
我使用基礎的SCSS文件如下(大部分是默認):
//
// Foundation Variables
//
// The default font-size is set to 100% of the browser style sheet (usually 16px)
// for compatibility with brower-based text zoom or user-set defaults.
$base-font-size: 100% !default;
// $base-line-height is 24px while $base-font-size is 16px
// $base-line-height: 150%;
// This is the default html and body font-size for the base em value.
// Since the typical default browser font-size is 16px, that makes the calculation for grid size.
// If you want your base font-size to be a different size and not have it effect grid size too,
// set the value of $em-base to $base-font-size ($em-base: $base-font-size;)
$em-base: 16px !default;
// Working in ems is annoying. Think in pixels by using this handy function, emCalc(#px)
@function emCalc($pxWidth) {
@return $pxWidth/$em-base * 1em;
}
// Colors
$primary-color: #2ba6cb;
$secondary-color: #e9e9e9;
$alert-color: #c60f13;
$success-color: #5da423;
// Make sure border radius matches unless we want it different.
$global-radius: 3px;
// Media Queries
$small-screen: emCalc(768px);
$medium-screen: emCalc(1280px);
$large-screen: emCalc(1440px);
//
// Form Variables
//
// Base for lots of form spacing and positioning styles
// $form-spacing: emCalc(16px);
// Labels
$form-label-pointer: pointer;
$form-label-font-size: emCalc(14px);
$form-label-font-weight: 500;
$form-label-font-color: lighten(#000, 30%);
$form-label-bottom-margin: emCalc(3px);
$input-font-family: inherit;
$input-font-color: rgba(0,0,0,0.75);
$input-font-size: emCalc(14px);
$input-bg-color: #fff;
$input-focus-bg-color: darken(#fff, 2%);
$input-border-color: darken(#fff, 20%);
$input-focus-border-color: darken(#fff, 40%);
$input-border-style: solid;
$input-border-width: 1px;
$input-disabled-bg: #ddd;
$input-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
// Button background
$button-bg-color: #D8E1ED;
// Button text styles.
// $button-font-family: inherit;
// $button-font-color: #fff;
// $button-font-color-alt: #333;
$button-font-med: emCalc(16px);
// $button-font-tny: emCalc(11px);
// $button-font-sml: emCalc(13px);
// $button-font-lrg: emCalc(20px);
// $button-font-weight: bold;
// $button-font-align: center;
// Various hover effects.
$button-function-factor: 10%;
// Button border styles.
$button-border-width: 1px;
$button-border-style: solid;
$button-border-color: darken($primary-color, $button-function-factor);
// Radius used throughout the core.
$button-radius: 6px;
// Opacity for disabled buttons.
$button-disabled-opacity: 0.6;
//
// Top Bar Variables
//
// Background color for the top bar
$topbar-bg: #222;
// Height and margin
// $topbar-height: 45px;
$topbar-margin-bottom: emCalc(30px);
// Input height for top bar
$topbar-input-height: 2.45em;
// Title in the top bar
$topbar-title-weight: bold;
$topbar-title-font-size: emCalc(17px);
// Link colors and styles for top-level nav
$topbar-link-color: #fff;
$topbar-link-weight: bold;
$topbar-link-font-size: emCalc(13px);
$topbar-link-hover-lightness: -50% !default; // Darken by 30%
// Top bar dropdown elements
// $topbar-dropdown-bg: #333;
// $topbar-dropdown-link-color: #fff;
// $topbar-dropdown-toggle-size: 5px;
// $topbar-dropdown-toggle-color: #fff;
// $topbar-dropdown-toggle-alpha: 0.5;
// $dropdown-label-color: #555;
// Top menu icon styles
$topbar-menu-link-transform: uppercase;
$topbar-menu-link-font-size: emCalc(13px);
$topbar-menu-link-weight: bold;
$topbar-menu-link-color: #fff;
$topbar-menu-icon-color: #fff;
$topbar-menu-link-color-toggled: #888;
$topbar-menu-icon-color-toggled: #888;
// Transitions and breakpoint styles
$topbar-transition-speed: 900ms;
$topbar-breakpoint: $small-screen;
$topbar-media-query: "only screen and (min-width: "#{$topbar-breakpoint}")";
@import 'foundation';
什麼引起了這種非常規的灰色背景是.top-bar.expanded .toggle-topbar a span {0} 0 0 0 0 0 0 1px#888888,0 16px 0 1px#888888,0 22px 0 1px#888888; } 這實際上是在下載版本。對我來說似乎是一個錯誤,而不是意圖。 –
是的,但在官方網站上,3條水平線的風格是「box-shadow:0 10px 0 1px white,0 16px 0 1px white,0 22px 0 1px white;」當沒有展開時,「box-shadow:0 10px 0 1px#888888,0 16px 0 1px#888888,0 22px 0 1px#888888;」擴展時。這些與你提到的風格相同,在他們的網站上看起來很好。 – joshm1
好吧,我以爲你指的是http://foundation.zurb.com/。 –