Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <ul class="drop-down-menu">
	<li>
		<a href="#">關於我們</a>
		<ul>
			<li>
				<a href="#">服務據點</a>
			</li>
			<li>
				<a href="#">服務客戶</a>
			</li>
			<li>
				<a href="#">服務地區</a>
			</li>
			<li>
				<a href="#">徵才資訊</a>
			</li>
		</ul>
	</li>
	<li>
		<a href="#">Magento</a></li>
		<li>
			<a href="#">服務項目</a>
			<ul>
				<li>
					<a href="#">系統整合</a>
					<ul>
						<li>
							<a href="#">Magento與POS訂單系統整合</a>
						</li>
						<li>
							<a href="#">Magento與CRM客戶管理系統整合</a>
						</li>
						<li>
							<a href="#">Magento與ERP管理系統整合</a>
						</li>
						<li>
							<a href="#">Magento金流串接服務</a>
						</li>
					</ul>
				</li>
				<li>
					<a href="#">專業網頁設計</a>
					<ul>
						<li>
							<a href="#">響應式網頁設計 (Responsive Web Design)</a>
						</li>
						<li>
							<a href="#">手機網站設計</a>
						</li>
						<li>
							<a href="#">WordPress 網頁設計</a>
						</li>
					</ul>
				</li>
				<li>
					<a href="#">網路行銷服務</a>
					<ul>
						<li>
							<a href="#">Amazon亞馬遜網路商城</a>
						</li>
						<li>
							<a href="#">社群媒體行銷</a>
						</li>
						<li>
							<a href="#">SEO 搜尋引擎優化</a>
							<ul>
								<li>
									<a href="#">在地SEO</a>
								</li>
								<li>
									<a href="#">SEO 搜尋引擎優化</a>
								</li>
							</ul>
						</li>
					</ul>
				</li>
				<li>
					<a href="#">網站客製開發</a>
				</li>
			</ul>
		</li>
		<li>
			<a href="#">專案介紹</a>
		</li>
		<li>
			<a href="#">資訊分享</a>
		</li>
		<li>
			<a href="#">聯絡我們</a>
		</li>
	</ul>
              
            
!

CSS

              
                ul {
  /* 取消ul預設的內縮及樣式 */
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.drop-down-menu {
  border: #ccc 1px solid;
  display: inline-block;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 13px;
}

ul.drop-down-menu li {
  position: relative;
  white-space: nowrap;
  border-right: #ccc 1px solid;
}

ul.drop-down-menu>li:last-child {
  border-right: none;
}

ul.drop-down-menu>li {
  float: left;
  /* 只有第一層是靠左對齊*/
}

ul.drop-down-menu a {
  background-color: #fff;
  color: #333;
  display: block;
  padding: 0 30px;
  text-decoration: none;
  line-height: 40px;
}

ul.drop-down-menu a:hover {
  /* 滑鼠滑入按鈕變色*/
  background-color: #ef5c28;
  color: #fff;
}

ul.drop-down-menu li:hover>a {
  /* 滑鼠移入次選單上層按鈕保持變色*/
  background-color: #ef5c28;
  color: #fff;
}

ul.drop-down-menu ul {
  border: #ccc 1px solid;
  position: absolute;
  z-index: 99;
  left: -1px;
  top: 100%;
  min-width: 180px;
}

ul.drop-down-menu ul li {
  border-bottom: #ccc 1px solid;
}

ul.drop-down-menu ul li:last-child {
  border-bottom: none;
}

ul.drop-down-menu ul ul {
  /*第三層以後的選單出現位置與第二層不同*/
  z-index: 999;
  top: 10px;
  left: 90%;
}

ul.drop-down-menu ul {
  /*隱藏次選單*/
  display: none;
}

ul.drop-down-menu li:hover>ul {
  /* 滑鼠滑入展開次選單*/
  display: block;
}
              
            
!

JS

              
                
              
            
!
999px

Console