Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <div class="container">
	<div class="menu-box">
		<h2>甜點類別</h2>
		<ul class="menu">
			<li class="menu-first"><a href="#">所有甜點 (45)</a></li>
			<li><a href="#">本日精選 (10)</a></li>
			<li><a href="#">人氣精選 (26)</a></li>
			<li><a href="#">新品上市 (12)</a></li>
		</ul>
	</div>
		<ul class="content">
		<li class="item">
			<img src="https://hexschool.github.io/flexImgUrl/10/pic1.png" alt="items">
			<div class="title">
				<div class="name">
					<p>焦糖甜甜圈</p>
				</div>
				<div class="price">
					<p>NT$ 450</p>
				</div>
			</div>
			<div class="add">
				 <h3><a href="#">加入購物車</a></h3>
			</div>
		</li>
		<li class="item">
			<img src="https://hexschool.github.io/flexImgUrl/10/pic2.png" alt="items">
			<div class="title">
				<div class="name">
					<p>焦糖甜甜圈</p>
				</div>
					<p class="price">NT$ 450</p>
			</div>
			<div class="add">
				 <h3><a href="#">加入購物車</a></h3>
			</div>
		</li>
		<li class="item">
			<img src="https://hexschool.github.io/flexImgUrl/10/pic3.png" alt="items">
			<div class="title">
				<div class="name">
					<p>焦糖甜甜圈</p>
					<p class="price">NT$ 450</p>
			<div class="add">
				 <h3><a href="#">加入購物車</a></h3>
			</div>
		</li>
	</ul>
</div>
              
            
!

CSS

              
                body{
  font-family: Microsoft JhengHei;
}

.container{
	width:1000px;
	margin: 0 auto;
	display:flex;
}

.menu-box{
	width: 300px;
	text-align: center;
	padding: 0px 20px;
}

.menu-box h2{
	font-size: 20px;
	padding: 20px;
	color:white;
	background: #37523d;
	font-weight:bold;
}

.menu li{
	padding: 20px;
	border: 1px solid #e7eeea;
}

.menu li a{
	text-decoration:none;
	font-size: 20px;
	color: #37523d;
	font-weight:bold;
}

.menu-first{
	background: #e7eeea;
}

.content{
	display:flex;
	flex-wrap:wrap;
}

.item{
	margin-bottom:20px;
	margin-right: 20px;
}

/* 去除img下方空隙 */
.item img { 
  display: block;
}

.title{
	display:flex;
	justify-content:space-around;
	border: 1px solid #e7eeea; 
}

.name,.price{
	color: #37523d;
	font-size: 23px;
	font-weight:bold;
	padding:20px;
}

.name{
	border-right: 1px solid #e7eeea; 
}

.add{
	background: #e7eeea;
	text-align:center;
}

.add h3 a{
		padding:30px;
		color:#37523d;
		font-size: 20px;
		font-weight:bold;
		display: block;
		text-decoration:none;
}

.add h3 a:hover{
	color: white;
	background: #37523d;
	transition: .5s ease-in;
}
              
            
!

JS

              
                
              
            
!
999px

Console