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

              
                <style>
	div {
		width: 100%;
		height: 300px;
		margin: 20px;
		font-size: 30px;
		font-weight: bolder;
	}

	.bgt1 {
		background: linear-gradient(rgba(255, 255, 255, 40%), rgba(255, 255, 255, 40%)),
			url(https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcpByqt%2FbtsKfqMCV9v%2F5nxRnrFPvetk2HamQg6Dh1%2Fimg.png);
	}

	.bgt2 {
		background: linear-gradient(rgba(0, 0, 0, 40%), rgba(0, 0, 0, 40%)),
			url(https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcpByqt%2FbtsKfqMCV9v%2F5nxRnrFPvetk2HamQg6Dh1%2Fimg.png);
	}

	.bgt3 {
		background: linear-gradient(rgb(255, 99, 71, 40%), rgb(255, 99, 71, 40%)),
			url(https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcpByqt%2FbtsKfqMCV9v%2F5nxRnrFPvetk2HamQg6Dh1%2Fimg.png);
	}

	.bgo {
		background: url(https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcpByqt%2FbtsKfqMCV9v%2F5nxRnrFPvetk2HamQg6Dh1%2Fimg.png);
		opacity: 0.5;
	}
</style>

<div class="bgt1">배경이미지에만 투명도 넣기</div>
<div class="bgt2">배경이미지에만 투명도 넣기</div>
<div class="bgt3">배경이미지에만 투명도 넣기</div>
<div class="bgo">opacity로 투명도를 주면 글자도 투명해진다.</div>

<p>linear-gradient이용하면 원하는 색을 입혀 투명도를 조절할 수 있다. before, after 쓰는 것 보다 간편하고 글자에는 투명도가 적용되지 않는다.</p>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console