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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div class="wrap">
	<div class="container">
		<div class="item">
			<div class="pic">
				<img src="https://picsum.photos/400/400?random=10">
			</div>
			<div class="txt">
				<h2>金魚都能懂的網頁入門</h2>
				<p>年度最佳網頁入門教學影片,輕鬆學會網頁製作,原始碼原來如此有趣啊。</p>
				<a href="#" class="btn">more</a>
			</div>
		</div>
		<div class="item">
			<div class="pic">
				<img src="https://picsum.photos/400/400?random=11">
			</div>
			<div class="txt">
				<h2>金魚都能懂的網頁切版</h2>
				<p>沒想到切版竟然如此簡單,以往的困難迎刃而解,技巧原來這般單純。</p>
				<a href="#" class="btn">more</a>
			</div>
		</div>
		<div class="item">
			<div class="pic">
				<img src="https://picsum.photos/400/400?random=12">
			</div>
			<div class="txt">
				<h2>金魚都能懂的CSS選取器</h2>
				<p>CSS選取器原來是這道理啊,其實之前都誤解她了,對不起 9523 !</p>
				<a href="#" class="btn">more</a>
			</div>
		</div>
	</div>
</div>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Noto+Sans+TC:100,300,400,500,700,900&display=swap");
*{
	margin: 0;
	padding: 0;
	list-style: none;
}
.wrap{
	height: 100vh;
	display: flex;
	align-items: center;
	background: linear-gradient(-30deg,#fdaecb,#e7597f,#fe8556);
}
.container{
	width: 1200px;
	margin: auto;
	display: flex;
	flex-wrap: wrap;
}
.item{
	width: 368px;
	margin: 0 15px;
	display: flex;
	background-color: #fff;
	border: 1px solid #888;
	box-shadow: 0 10px 30px rgba(160,0,0,.5);
	font-family: 'Noto Sans TC', sans-serif;
}
.item .pic{
	width: 50%;
}
.item .pic img{
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.item .txt{
	width: 50%;
	padding: 20px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}
.item .txt h2{
	font-weight: 500;
	margin-bottom: .4em;
}
.item .txt p{
	font-weight: 300;
}
.item .txt .btn{
	line-height: 1.5em;
	border:1px solid #ccc;
	padding: 0 1em;
	align-self: flex-end;
	text-decoration: none;
	border-radius: 200px;
	margin-top: auto;
	color: #aaa;
}
.item .txt .btn:hover{
	background-color: #ccc;
	color: #fff;
}
              
            
!

JS

              
                
              
            
!
999px

Console