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="post_photo">
	    <div class="new_bg">
	    	<span class="new">New</span>
	    </div>
	    <img src="http://puzzle-sample.com/images/flex.jpg" alt="sample" />
	</div>

	<div class="post_photo_se">
	    <div class="new_bg">
	    	<span class="new">New</span>
	    </div>
	    <img src="http://puzzle-sample.com/images/flex.jpg" alt="sample" />
	</div>

	<div class="post_photo_th">
	    <div class="new_bg">
	    	<span class="new">New</span>
	    </div>
	    <img src="http://puzzle-sample.com/images/flex.jpg" alt="sample" />
	</div>

	<div class="post_photo_four">
	  <span class="new_fo">NEW!</span>
	  <img src="http://puzzle-sample.com/images/flex.jpg" alt="sample" />
	</div>

	<div class="ribbon_new">
	  <div class="new_area">
	    <span class="new_fi">NEW</span>
	  </div>
	    <img src="http://puzzle-sample.com/images/flex.jpg" alt="sample" />
    </div>

    <div class="ribbon_new_sec">
	  <span class="new_area_sec">NEW</span>
	  <div>
	    <img src="http://puzzle-sample.com/images/flex.jpg" alt="sample" />
	  </div>
    </div>
              
            
!

CSS

              
                *, *:after, *:before {
			-webkit-box-sizing:
			border-box;
			-moz-box-sizing:
			border-box;
			box-sizing:
			border-box;
			
		}
body, html { 
			font-size: 100%;
		    padding: 0;
		    margin: 0;
		    font-family: "メイリオ", Meiryo, Osaka, "MS Pゴシック", "MS PGothic", sans-serif;
		}
img{
	margin: 0;
	padding: 0;
	vertical-align:bottom;
}
		.post_photo{
			width: 370px;
			margin: 100px auto;
			padding: 0;
			position: relative;
		}
		.post_photo img{
			position: relative;
			z-index: 1;
		}
		.post_photo .new_bg{
			position: absolute;
			top: 0;
            left: 0;
            z-index: 2;
		}
		.post_photo .new_bg::before{
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			width: 0;
			height: 0;
			border-style: solid;
			border-width: 80px 80px 0 0;
			border-color: #007bff transparent transparent transparent;
			filter:alpha(opacity=50);
            -moz-opacity: 0.5;
            opacity: 0.5;
		}
		.post_photo .new_bg .new{
			position: absolute;
			top: 15px;
            left: 5px;
            z-index: 3;
            color: #fff;
            transform: rotate(-45deg);
		}
		


		.post_photo_se{
			width: 370px;
			margin: 100px auto;
			padding: 0;
			position: relative;
		}
		.post_photo_se img{
			position: relative;
			z-index: 1;
		}
		.post_photo_se .new_bg{
			position: absolute;
			top: 0;
            left: 0;
            z-index: 2;
		}
		.post_photo_se .new_bg::before{
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			width: 0;
			height: 0;
			border-style: solid;
			border-width: 80px 80px 0 0;
			border-color: #007bff transparent transparent transparent;
			filter:alpha(opacity=50);
            -moz-opacity: 0.5;
            opacity: 0.5;
		}
		.post_photo_se .new_bg::after{
			content: "";
			position: absolute;
			border: dashed 0px white;
			box-shadow: 0px 0px 0px 10px #007bff;
			filter:alpha(opacity=50);
            -moz-opacity: 0.5;
            opacity: 0.5;

		}
		.post_photo_se .new_bg .new{
			position: absolute;
			top: 15px;
      left: 5px;
      z-index: 3;
      color: #fff;
      transform: rotate(-45deg);
		}





		.post_photo_th{
			width: 370px;
			margin: 100px auto;
			padding: 0;
			position: relative;
		}
		.post_photo_th img{
			position: relative;
			z-index: 1;
		}
		.post_photo_th .new_bg{
			position: absolute;
			top: 0;
      left: 0;
      z-index: 2;
		}
		
		.post_photo_th .new_bg .new{
			position: absolute;
			top: 30px;
      left: 30px;
      z-index: 5;
      color: #fff;
            
            
		}
		.post_photo_th .new_bg .new::before{
			content: "";
			position: absolute;
			background: #007bff;
			width: 60px;
			height: 60px;
			border-radius: 50%;
			top: -18px;
      left: -15px;
			z-index: -1;
			filter:alpha(opacity=50);
            -moz-opacity: 0.5;
            opacity: 0.5;
		}
		





.post_photo_four {    
    display: block;
    position: relative;
    margin: 60px auto;
    padding: 0;
    width: 370px;
   
  }
.new_fo {
    display: inline-block;
    position: absolute;
    left: 0;
    top: 5px;
    box-sizing: border-box;
    padding: 0 12px;
    margin: 0;
    height: 30px;
    line-height: 30px;
    font-size: 18px;
    letter-spacing: 0.1em;
    color: #fff;
    background-color: rgba(20,124,237,0.8);
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.12);
   
}
.new_fo:before {
    position: absolute;
    content: '';
    top: 0;
    left: -7px;
    border: none;
    height: 38px;
    width: 7px;
    background-color: rgba(20,124,237,0.8);
    border-radius: 5px 0 0 5px;
   
}
.new_fo:after {
    position: absolute;
    content: '';
    bottom: -7px;
    left: -5px;
    border: none;
    height: 7px;
    width: 5px;
    background: #4d99ca;
    border-radius: 5px 0 0 5px;
}





.ribbon_new{
    display: block;
    position: relative;
    margin: 60px auto;
    padding: 0;
    width: 370px;
}

.new_area {
    position: absolute;
    top: 0;
    right: 0;
    width: 85px;
    height: 85px;
    overflow: hidden;
  }

.new_fi {
    display: inline-block;
    position: absolute;
    padding: 5px 0;
    left: -24px;
    top: 20px;
    width: 160px;
    text-align: center;
    font-size: 18px;
    line-height: 16px;
    background-color: rgba(20,124,237,0.8);
    color: #fff;
    letter-spacing: 0.05em;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
    box-shadow: 0 0 0 2px rgba(20,124,237,0.8);
    border-top: dashed 1px rgba(255, 255, 255, 0.65);
    border-bottom: dashed 1px rgba(255, 255, 255, 0.65);
}





.ribbon_new_sec {    
    display: block;
    position: relative;
    margin: 60px auto;
    padding: 0;
    width: 370px;
    
   
  }

.new_area_sec {    
    display: inline-block;
    position: absolute;
    top: -6px;
    left: 10px;
    margin: 0;
    padding: 10px 0 7px;
    z-index: 2;
    width: 40px;
    text-align: center;
    color: white;
    font-size: 13px;
    background-color: rgba(20,124,237,0.8);
    border-radius: 2px 0 0 0;
  }

.new_area_sec:before{
    position: absolute;
    content: '';
    top: 0;
    right: -5px;
    border: none;
    border-bottom: solid 6px #4d99ca;
    border-right: solid 5px transparent;
}

.new_area_sec:after{
    content: '';
    position: absolute;
    left: 0;
    top: 100%;
    height: 0;
    width: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 10px solid rgba(20,124,237,0.8);
}
              
            
!

JS

              
                
              
            
!
999px

Console