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 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

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

              
                <article id="article">
		<aside id="sidebar">
			<form id="data" action="http://apps.eky.hk/css-triangle-generator" method="get">
				<fieldset id="fieldset-direction">
					<legend id="legend-direction">Direction</legend>
					<ul id="direction1" class="directions">
						<li>
							<input type="radio" name="direction" id="direction-top" value="top" checked />
								<label for="direction-top">Top</label>
						<li>
							<input type="radio" name="direction" id="direction-right" value="right" />
								<label for="direction-right">Right</label>
						<li>
							<input type="radio" name="direction" id="direction-bottom" value="bottom" />
								<label for="direction-bottom">Bottom</label>
						<li>
							<label for="direction-left">Left</label>
								<input type="radio" name="direction" id="direction-left" value="left" />
					</ul>
					<ul id="direction2" class="directions">
						<li>
							<input type="radio" name="direction" id="direction-topRight" value="topRight" />
								<label for="direction-topRight">Top right</label>
						<li>
							<input type="radio" name="direction" id="direction-bottomRight" value="bottomRight" />
								<label for="direction-bottomRight">Bottom right</label>
						<li>
							<label for="direction-bottomLeft">Bottom left</label>
								<input type="radio" name="direction" id="direction-bottomLeft" value="bottomLeft" />
						<li>
							<label for="direction-topLeft">Top left</label>
								<input type="radio" name="direction" id="direction-topLeft" value="topLeft" />
					</ul>
					<div role="img" id="triangleDirection" class="selected-top">
						<div class="corners">
							<label for="direction-topRight" class="triangle topRight"></label>
							<label for="direction-bottomRight" class="triangle bottomRight"></label>
							<label for="direction-bottomLeft" class="triangle bottomLeft"></label>
							<label for="direction-topLeft" class="triangle topLeft"></label>
						</div>
						<div class="corners rotate-45">
							<label for="direction-top" class="triangle top"></label>
							<label for="direction-bottom" class="triangle bottom"></label>
							<label for="direction-right" class="triangle right"></label>
							<label for="direction-left" class="triangle left"></label>
						</div>
						<div role="img" id="centerFill"></div>
					</div>
				</fieldset>
				<fieldset id="fieldset-type">
					<legend id="legend-type">Type</legend>
					<input type="checkbox" name="ie6" id="ie6" value="support" />
						<label for="ie6">IE6 support (add chroma filter)</label>
					<ul>
						<li id="equilateral">
							<input type="radio" name="type" id="type-equ" value="equ" />
								<label for="type-equ">Equilateral</label>
						<li>
							<input type="radio" name="type" id="type-iso" value="iso" checked />
								<label for="type-iso">Isosceles</label>
						<li>
							<input type="radio" name="type" id="type-sca" value="sca" />
								<label for="type-sca">Scalene</label>
					</ul>
				</fieldset>
				<fieldset id="fieldset-size">
					<legend id="legend-size">Size</legend>
					<ul>
						<li>
							<label for="width">Width</label>
							<input name="width" id="width" value="200" type="number" />px
							<ul>
								<li>
									<label for="width-left">Left</label>
									<input name="width-left" id="width-left" value="100" type="number" />px
								<li>
									<label for="width-right">Right</label>
									<input name="width-right" id="width-right" value="100" type="number" />px
							</ul>
						</li>
						<li>
							<label for="height">Height</label>
							<input name="height" id="height" value="100" type="number" />px
							<ul>
								<li>
									<label for="height-top">Top</label>
									<input name="height-top" id="height-top" value="50" type="number" />px
								<li>
									<label for="height-bottom">Bottom</label>
									<input name="height-bottom" id="height-bottom" value="50" type="number" />px
							</ul>
						</li>
					</ul>
				</fieldset>
				<fieldset>
					<legend id="legend-color">Color</legend>
					<input name="color" id="color" type="color" value="#007bff" />
					<div id="colorPicker"></div>
				</fieldset>
				<input id="update" name="update" type="submit" value="Update" />
			</form>
		</aside>
		<div id="workArea">
			<div id="triangleOutput">
				<div id="triangle"></div>
			</div>
			<div id="cssOutput">
				<h1>CSS</h1>
				<textarea id="css" rows="8" cols="100">width: 0;
height: 0;
border-style: solid;
border-width: 0 100px 100px 100px;
border-color: transparent transparent #007bff transparent;</textarea>
			</div>
			<div id="tips">
				<h1>Tips</h1>
				<ul>
					<li>Try <code>border-style: inset</code> if Firefox renders a strange gray border
					<li>Add <code>-webkit-transform:rotate(360deg)</code> for a better anti-aliasing in webkit browser
				</ul>
			</div>
					</div>
	</article>
              
            
!

CSS

              
                body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { 
	margin:0;
	padding:0;
}
table {
	border-collapse:collapse;
	border-spacing:0;
}
fieldset,img { 
	border:0;
}
address,caption,cite,code,dfn,em,strong,th,var {
	font-style:normal;
	font-weight:normal;
}
ol,ul {
	list-style:none;
}
caption,th {
	text-align:left;
}
q:before,q:after {
	content:'';
}
abbr,acronym { border:0;}
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
	display: block;
}
html.full, html.full body {
	font-family:Corbel, 'MS PGothic', 'Microsoft JhengHei', Arial, Verdana, Helvetica, sans-serif;
}
input, select, textarea{
	font-family:Arial, Verdana, Helvetica, sans-serif;
}
a{
	color:#197882;
	text-decoration:none;
}
.clearfix:after { content: "."; display:block; height:0px; clear:both; visibility:hidden; }
.clearfix { zoom:1 \9; display:block; }

hr{
	border:1px #666 solid;
	width:100%;
	margin:20px 0;
}
#top{
	width:100%;
	height:90%;
	position:relative;
	overflow:auto;
}
#header{
	height:65px;
	width:100%;
	background:#eee;
	position:relative;
	padding:10px 0 20px;
}
#header .title{
	font-size:36px;
	text-align:center;
}
#header #subTitle{
	font-size:18px;
	text-align:center;
}
#social{
	font-size:24px;
	position:absolute;
	right:20px;
	top:0px;
	width:50px;
	height:200px;
	color:#666;
}
#social .fb-like{
	position:absolute;
	top:0;
}
#social .fb-like > span{
	position:absolute !important;
	top:45px;
	height:30px !important;
}
#social .twitter-share-button{
	position:absolute !important;
	top:0px;
	padding-top:0px;
}
#___plusone_0{
	position:absolute !important;
	top:27px;
	padding-left:5px;
	padding-top:5px;
}

#footer{
	height:90px;
	width:100%;
	background:#eee;
	overflow:hidden;
	position:relative;
	clear:both;
}
html.full #footer{
	bottom:0;
	left:0;
	position:absolute;
}
#footer .title{
	display:block;
	font-size:24px;
	position:absolute;
	right:20px;
	top:30%;
	color:#666;
}
#footer .title a{
	color:#666;
}
#HTML5Logo{
	font-size:24px;
	position:absolute;
	left:20px;
	top:15%;
	color:#666;
}
.infoList{
	padding-top:20px;
	width:720px;
	margin:0 auto;
}
.infoList li{
	display:inline-block;
	vertical-align:top;
	margin-right:20px;
}
.infoSublist{
	margin-left:10px;
}
.infoSublist li{
	font-size:12px;
	display:inline-block;
}
.infoSublist.browserList{
	width:350px;
}
.infoSublist.verticalList li{
	display:block;
}
.colorpicker {
	width: 356px;
	height: 176px;
	overflow: hidden;
	position: absolute;
	background: url(../images/colorpicker_background.png);
	font-family: Arial, Helvetica, sans-serif;
	display: none;
}
.colorpicker_color {
	width: 150px;
	height: 150px;
	left: 14px;
	top: 13px;
	position: absolute;
	background: #f00;
	overflow: hidden;
	cursor: crosshair;
}
.colorpicker_color div {
	position: absolute;
	top: 0;
	left: 0;
	width: 150px;
	height: 150px;
	background: url(../images/colorpicker_overlay.png);
}
.colorpicker_color div div {
	position: absolute;
	top: 0;
	left: 0;
	width: 11px;
	height: 11px;
	overflow: hidden;
	background: url(../images/colorpicker_select.gif);
	margin: -5px 0 0 -5px;
}
.colorpicker_hue {
	position: absolute;
	top: 13px;
	left: 171px;
	width: 35px;
	height: 150px;
	cursor: n-resize;
}
.colorpicker_hue div {
	position: absolute;
	width: 35px;
	height: 9px;
	overflow: hidden;
	background: url(../images/colorpicker_indic.gif) left top;
	margin: -4px 0 0 0;
	left: 0px;
}
.colorpicker_new_color {
	position: absolute;
	width: 60px;
	height: 30px;
	left: 213px;
	top: 13px;
	background: #f00;
}
.colorpicker_current_color {
	position: absolute;
	width: 60px;
	height: 30px;
	left: 283px;
	top: 13px;
	background: #f00;
}
.colorpicker input {
	background-color: transparent;
	border: 1px solid transparent;
	position: absolute;
	font-size: 10px;
	font-family: Arial, Helvetica, sans-serif;
	color: #898989;
	top: 4px;
	right: 11px;
	text-align: right;
	margin: 0;
	padding: 0;
	height: 11px;
}
.colorpicker_hex {
	position: absolute;
	width: 72px;
	height: 22px;
	background: url(../images/colorpicker_hex.png) top;
	left: 212px;
	top: 142px;
}
.colorpicker_hex input {
	right: 6px;
}
.colorpicker_field {
	height: 22px;
	width: 62px;
	background-position: top;
	position: absolute;
}
.colorpicker_field span {
	position: absolute;
	width: 12px;
	height: 22px;
	overflow: hidden;
	top: 0;
	right: 0;
	cursor: n-resize;
}
.colorpicker_rgb_r {
	background-image: url(../images/colorpicker_rgb_r.png);
	top: 52px;
	left: 212px;
}
.colorpicker_rgb_g {
	background-image: url(../images/colorpicker_rgb_g.png);
	top: 82px;
	left: 212px;
}
.colorpicker_rgb_b {
	background-image: url(../images/colorpicker_rgb_b.png);
	top: 112px;
	left: 212px;
}
.colorpicker_hsb_h {
	background-image: url(../images/colorpicker_hsb_h.png);
	top: 52px;
	left: 282px;
}
.colorpicker_hsb_s {
	background-image: url(../images/colorpicker_hsb_s.png);
	top: 82px;
	left: 282px;
}
.colorpicker_hsb_b {
	background-image: url(../images/colorpicker_hsb_b.png);
	top: 112px;
	left: 282px;
}
.colorpicker_submit {
	position: absolute;
	width: 22px;
	height: 22px;
	background: url(../images/colorpicker_submit.png) top;
	left: 322px;
	top: 142px;
	overflow: hidden;
}
.colorpicker_focus {
	background-position: center;
}
.colorpicker_hex.colorpicker_focus {
	background-position: bottom;
}
.colorpicker_submit.colorpicker_focus {
	background-position: bottom;
}
.colorpicker_slider {
	background-position: bottom;
}html{
	display:block !important;
}
#headerInner{
	width:780px;
	margin:0 auto;
	position:relative;
}
#locales{
	position:absolute;
	right:80px;
	top:0px;
}
#locales li{
	list-style:none;
	line-height:12px;
}
#locales li a{
	font-size:12px;
}
:disabled{
	background:#ddd;
	color:#666
}
#title{
	font-size:24px;
	padding:10px 0;
	text-align:center;
}
#article{
	width:760px;
	margin:0 auto;
}
#sidebar{
	width:380px;
	padding:0 10px;
	height:100%;
	background:#eee;
	float:left;
	overflow:auto;
}
#workArea{
	margin-left:400px;
	height:100%;
	width:380px;
}
#triangleOutput{
	display:block;
	min-height:300px;
	min-width:380px;
	background:url('transparent.png') 0 0 repeat;
}
#cssOutput{
	display:block;
	width:380px;
	height:150px;
	background:#fff;
	position:relative;
	padding-left:10px;
}
#cssOutput h1{
	font-size:24px;
	height:24px;
	text-indent:4px;
}
#css{
	width:370px;
	margin-top:10px;
	height:100px;
	border:0;
}
#tips{
	margin-bottom:20px;
}
#tips ul{
	margin-left:30px;
}
#tips li, #tips code{
	font-size:12px;
	list-style:disc;
}
#tips code{
	color:#592052;
}
#tips h1{
	font-size:24px;
	text-indent:14px;
}

#triangle{
	/* 
		Bug in Chrome 18+ and Safari 5.1.2+
		- http://labs.eky.hk/bug/webkit-border-width-transition/
		- https://bugs.webkit.org/show_bug.cgi?id=77560
		
		-webkit-transition:.3s;
	*/
	-moz-transition:.3s;
	-ms-transition:.3s;
	-o-transition:.3s;
	transition:.3s;
	border-style: solid;
	width: 0px;
	height: 0px;
	line-height: 0px;
	border-width: 0px 100px 100px 100px;
	border-color: transparent transparent #007bff transparent;
	_border-color: #000 #000 #007bff #000;
	_filter:progid:DXImageTransform.Microsoft.Chroma(color='#000000');
}
#data{

}
#data legend{
	font-size:24px;
}
#data fieldset{
	padding:10px;
	padding-right:0;
}
#data li{
	list-style:none;
}

#fieldset-direction{
	position:relative;
}
#direction1{
	float:left;
	width:120px;
}
#direction2{
	float:left;
}

#fieldset-type li{
	float:left;
	margin-right:20px;
}

#fieldset-size label,
#fieldset-size input{
	display:block;
	float:left;
}
#fieldset-size label{
	width:70px;
}
#fieldset-size ul{
	margin-left:20px;
}
#fieldset-size > ul{
	margin-left:0;
}
#fieldset-size li{
	clear:both;
}

.js #color{
	position:absolute;
	top:-100000px;
	left:-100000px;
}

#update{
	padding:10px;
	font-size:24px;
	margin:10px auto;
	display:block;
	width:100px;
	cursor:pointer;
}

:root #direction1,
:root #direction2{
	width:300px;
}

:root #direction1,
:root #direction1 li,
:root #direction2,
:root #direction2 li{
	position:absolute;
}
#direction1 li:nth-child(1){
	top:0;
	left:110px;
}
#direction1 li:nth-child(2){
	top:50px;
	left:180px;
}
#direction1 li:nth-child(3){
	top:100px;
	left:110px;
}
#direction1 li:nth-child(4){
	top:50px;
	left:40px;
}
#direction2 li:nth-child(1){
	top:20px;
	left:170px;
}
#direction2 li:nth-child(2){
	top:80px;
	left:170px;
}
#direction2 li:nth-child(3){
	top:80px;
	right:205px;
}
#direction2 li:nth-child(4){
	top:20px;
	right:205px;
}

#triangleDirection{
	display:none;
	position:relative;
}
:root #triangleDirection{
	display:block;
	clear:both;
	position:relative;
	width:70px;
	height:45px;
	margin:30px 0 50px 100px;
}
.corners{
	position:absolute;
	top:0;
	left:0;
	width:60px;
	height:60px;
}
.corners.rotate-45{
	width:54px;
	height:54px;
	margin:4px 0 0 4px;
	-webkit-transform:rotate(-45deg);
	-moz-transform:rotate(-45deg);
	-ms-transform:rotate(-45deg);
	-o-transform:rotate(-45deg);
	transform:rotate(-45deg);
}
.corners > label{
	position:absolute;
	width:30px;
	height:30px;
	background:#0094FF;
	cursor:pointer;
}
.corners.rotate-45 > label{
	width:27px;
	height:27px;
	background:#77F1FF;
}
.corners > label:hover{
	background:#FF77F1;
}
.corners .topRight,
.corners .top{
	top:0;
	right:0;
}
.corners .bottomRight,
.corners .right{
	bottom:0;
	right:0;
}
.corners .bottomLeft,
.corners .bottom{
	bottom:0;
	left:0;
}
.corners .topLeft,
.corners .left{
	top:0;
	left:0;
}
#centerFill{
	position:absolute;
	top:12px;
	left:12px;
	width:38px;
	height:38px;
	background:#fff;
}
.selected-top .triangle.top,
.selected-bottom .triangle.bottom,
.selected-left .triangle.left,
.selected-right .triangle.right,
.selected-topRight .triangle.topRight,
.selected-bottomRight .triangle.bottomRight,
.selected-bottomLeft .triangle.bottomLeft,
.selected-topLeft .triangle.topLeft{
	background:#FF77F1;
}

              
            
!

JS

              
                //http://apps.eky.hk/css-triangle-generator/
              
            
!
999px

Console