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

              
                	<article>
		<section>
			<header>
				<h1><a href="#"><img src="https://tatsuya-lab.com/wp-content/uploads/2020/02/title.png" alt="Landscape"/></a></h1>
				<h2><img src="https://tatsuya-lab.com/wp-content/uploads/2020/02/sub_title.png" alt="a peaceful landscape"/></h2>
			</header>
			<nav>
				<ul>
					<li><a href="#">about</a></li>
					<li><a href="#">blog</a></li>
					<li><a href="#">price</a></li>
					<li><a href="#">lesson</a></li>
					<li><a href="#">contact</a></li>
				</ul>
			</nav>
		</section>

		<main>
			<p>
				Nobody flips to transport, no eyes hear salt from seeing and never plays anything. <br>
				I thought about my face as a small child, thinking of the window <br>
				and hitting the door and shutting down at the door and looking at the carriage suddenly, <br>
				I saw my grandmother and it was a fire, so I could not fit the fire tonight I'm playing the music hall. <br>That Venus without Gauche was a sound of a music shop because he wanted something to sound. </p>
			</main>
		</article>
              
            
!

CSS

              
                * {
	margin: 0;
	padding: 0;

	box-sizing: border-box;/*paddingやborderをwidthやheightに吸収させるための設定*/
}
body, html {
	width: 100%;
	height: 100%;
}
article {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	background-image: url(https://tatsuya-lab.com/wp-content/uploads/2020/02/p-1.jpg);
	background-size: cover;
	background-position: center center;

	padding: 50px;/*余白をとる*/

	width: 100%;
	height: 100%;
}
p {
	font-size: 14px;
	line-height: 175%;
	color: white;
}
nav ul {
	display: flex;
	flex-wrap: wrap;
	list-style-type: none;
}
nav a:hover {
	border-radius: 5px;
	color: black;
	background-color: azure;
	opacity: .5;
}

h1 img, h2 img {
	max-width: 100%;
	height: auto;
}
nav{
	padding-bottom: 50px;
}
nav li {
	width: 100%;
	text-align: center;
}
nav a {
	font-size: 20px;
	display: block;
	text-decoration: none;
	color: white;
	padding: 5px 30px;
	border-bottom: 1px solid white;
}

/*幅768px以上に適用されるCSS(タブレットサイズ以上・幅990px以上にも適用される)*/
@media screen and (min-width:768px){

	article {
		border-radius: 20px;
	}
	nav ul{
		justify-content: space-between;
	}
	nav li {
		width: calc(50% - 15px);
	}
	nav a {
		font-size: 20px;
		display: block;
		text-decoration: none;
		color: white;
		padding: 5px 30px;
		border-bottom: 1px solid white;
	}

}

/*幅990px以上に適用されるCSS(PCサイズ以上・幅768px以上のCSSが干渉する)*/
@media screen and (min-width:990px){

	article {
		border-radius: 20px;
	}
	body {
		padding: 20px;	/*PCサイズでarticleの外に余白をとる*/
	}
	nav ul{
		flex-wrap: nowrap;
		justify-content: flex-start;
	}
	nav li {
		width: auto;
	}
	nav a {
		font-size: 20px;
		display: block;
		text-decoration: none;
		color: white;
		padding: 5px 30px;
		border: none;
	}

}
              
            
!

JS

              
                
              
            
!
999px

Console