cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div style="width:900px; text-align:left; margin: 0px auto 0px auto; padding:20px;">

<span class="navpart">Position and Borders</span>

<br />

<div class="left">

<span class="bolet">Width and height:</span> 
&nbsp;
html { height:100%; width:100%; }
&nbsp;
body { height:100%; width:100%; }

<br /><br />

<div class="showbor" style="height:30px; width:100px; text-align:center; float:right; margin:0px 0px 10px 15px;">
<div class="showbor" style="margin:0px auto 0px auto; height:20px; width: calc(100% - 50px);">
</div></div>

<span class="bolet">Calculate Size:</span> &nbsp;
width: calc(100% - 50px); 
<br /><br />

<span class="bolet">Resize and keep aspect ratio: </span>
&nbsp;
max-width:100px; 
&nbsp;
max-height:100px;
<br /><br />

<span class="bolet">Alignment:</span> &nbsp;
text-align:center;
&nbsp;
text-align:justify;
&nbsp;
text-align:left;
&nbsp;
text-align:right;
&nbsp;
This sets the alignment of other elements aside from text.
<br /><br />

<table style="float:left; margin:0px 20px 10px 0px;"><tr>

<td class="showbor" style="height:100px; width:80px; vertical-align:top; padding:5px;">top</td>

<td class="showbor" style="height:100px; width:80px; vertical-align:middle; padding:5px;">middle</td>

<td class="showbor" style="height:100px; width:80px; vertical-align:bottom; padding:5px;">bottom</td>

</tr></table>

<span class="bolet">Vertical alignment:</span> &nbsp;
vertical-align:top; 
&nbsp;
vertical-align:middle; 
&nbsp;
vertical-align:bottom; 
<br /><br />

<table style="float:right; margin:0px 0px 10px 20px;"><tr>

<td class="showbor"><div style="border:0px none; width:100px; height:100px; overflow:hidden; padding:5px;">
hidden hidden hidden hidden hidden hidden hidden hidden hidden hidden hidden hidden hidden hidden hidden
</div></td>

<td class="showbor"><div style="border:0px none; width:100px; height:100px; overflow:scroll; padding:5px;">
scrollscrollscroll scrollscrollscroll scrollscrollscroll scrollscrollscroll scrollscrollscroll scrollscrollscroll scrollscrollscroll
</div></td>

</tr> <tr>

<td class="showbor"><div style="border:0px none; width:100px; height:100px; overflow-y:hidden; overflow-x:scroll; padding:5px;">
horizontalhorizontalhorizontalhorizontalhorizontal 
</div></td>

<td class="showbor"><div style="border:0px none; width:100px; height:100px; overflow-y:scroll; overflow-x:hidden; padding:5px;">
vertical vertical vertical vertical vertical vertical vertical vertical vertical vertical vertical vertical 
</div></td>

</tr></table>

<span class="bolet">Overflow:</span> &nbsp;
&nbsp;
overflow:hidden; &nbsp; (no scrollbars)
<br />
overflow:scroll; &nbsp; (both scrollbars)
<br />
overflow-y:hidden; overflow-x:scroll; &nbsp; (horizontal scrollbar) 
<br />
overflow-y:scroll; overflow-x:hidden; &nbsp; (vertical scrollbar) 
<br /><br />

<span class="bolet">Position:</span> 
&nbsp;
position:absolute; left:100px; top:10px; &nbsp; (content scrolls)
<br />
position:absolute; right:100px; bottom:10px; &nbsp; (content scrolls)
<br />
position:fixed; top:10px; right:50px; &nbsp; (always visible on screen)
<br />
position:fixed; bottom:10px; left:50px; &nbsp; (always visible on screen)
<br />
position:relative; left:20px; top:10px; &nbsp; (relative to its original position, can have negative numbers)

<br /><br />

<div class="showbor" style="width:250px; 150px; margin:0px 20px 10px 20px; text-align:left; float:left;">

<span style="position:relative; left:15px; top:20px; z-index:7; display:inline-block; width:50px; height:50px; background-color:#ffbae8;"></span>

<span style="position:relative; left:130px; top:35px; z-index:7; display:inline-block; width:50px; height:50px; background-color:#5ec9ff;"></span>

<br />

<span style="position:relative; right:25px; bottom:5px; z-index:3; display:inline-block; width:50px; height:50px; background-color:#ffffa2;"></span>

<span style="position:relative; right:30px; bottom:10px; z-index:5; display:inline-block; width:50px; height:50px; background-color:#ffb8a2;"></span>

</div>

<span class="bolet">Layers: </span> 
&nbsp;
(largest are on top) 
&nbsp;
z-index:3;
&nbsp;
z-index:2;
&nbsp;
z-index:1;

<br /><br />

<span class="bolet">Make elements float: </span>
&nbsp; 
float:left;
&nbsp;
float:right;

<br /><br />

<span class="bolet">Padding:</span> (inside the element border)

&nbsp;
padding:10px; 
&nbsp;
padding:20px 50px 30px 40px; 
<br />
padding-top:20px;
&nbsp;
padding-right:50px;
&nbsp;
padding-bottom:30px;
&nbsp;
padding-left:40px;

<br /><br />

<span class="bolet">Margin:</span> (space outside the element border)

&nbsp;

margin:10px; 
&nbsp;
margin:10px 5px 10px 5px; 
<br />
margin-top:10%;
&nbsp;
margin-right:5px;
&nbsp;
margin-bottom:10%;
&nbsp;
margin-left:5px; 

<br /><br />

<span class="bolet">Horizontally center elements: </span>
&nbsp;
text-align:center; 
&nbsp;
(on the element containing it)
<br />
margin-right:auto; 
&nbsp; 
margin-left:auto; 
&nbsp;
or 
&nbsp; 
margin: 0px auto 0px auto; 
&nbsp;
(on the element)

<br /><br />

<span class="bolet">Borders:</span>

&nbsp;

border-width:3px;

&nbsp;

border-style:solid;

&nbsp;

border-color:#000000; 

&nbsp;

border:1px solid #000000;

&nbsp;

border:0px none;

&nbsp;

border-top-color:#000000;

&nbsp;

border-right-color:#ffffff;

&nbsp;

border-bottom-style:dashed;

&nbsp;

border-left-width:3px; 

<br /><br />

<div style="display:inline-block; margin:0px 10px 20px 10px; padding:7px; border-style:none;">none;</div>

<div style="display:inline-block; margin:0px 10px 20px 10px; padding:7px; border-style:solid; border-width:3px;">solid;</div>

<div style="display:inline-block; margin:0px 10px 20px 10px; padding:7px; border-style:dotted; border-width:3px;">dotted;</div>

<div style="display:inline-block; margin:0px 10px 20px 10px; padding:7px; border-style:dashed; border-width:3px;">dashed;</div>

<div style="display:inline-block; margin:0px 10px 20px 10px; padding:7px; border-style:double; border-width:3px;">double;</div>

<div style="display:inline-block; margin:0px 10px 20px 10px; padding:7px; border-style:outset; border-width:5px;">outset;</div>

<div style="display:inline-block; margin:0px 10px 20px 10px; padding:7px; border-style:inset; border-width:5px;">inset;</div>

<div style="display:inline-block; margin:0px 10px 20px 10px; padding:7px; border-style:ridge; border-width:5px;">ridge;</div>

<div style="display:inline-block; margin:0px 10px 20px 10px; padding:7px; border-style:groove; border-width:5px;">groove;</div>

<br />

<div class="showbor" style="display:inline-block; float:left; margin:0px 20px 10px 0px; padding:2px; border-top-style:solid; border-right-style:dashed; border-bottom-style:none; border-left-style:dotted; border-top-color:#53a8ff; border-right-color:#fffe87; border-left-color:#ff89ce; border-top-width:2px; border-right-width:4px; border-left-width:7px;"> <span style="font-size:20px;">&#x2606;</span> </div> 

<div style="margin:0px; padding:0px; width:50px; height:50px; border-radius: 5px 25px 5px 25px / 5px 25px 5px 25px; border:2px dashed #0050ff; background-color:#ffffff; float:left; margin:0px 20px 0px 0px;"><div style="margin:0px; padding:0px; width:50px; height:50px; border-radius: 5px 25px 5px 25px / 5px 25px 5px 25px; border-width:0px; background-color:#00bfff;"></div></div>

<div style="margin:0px; padding:0px; width:50px; height:50px; border-radius: 35px 35px 35px 35px / 35px 35px 35px 35px; border:3px dotted #3abdff; float:right; margin:0px 0px 0px 20px;"><div style="margin:0px; padding:0px; width:50px; height:50px; border-radius: 35px 35px 35px 35px / 35px 35px 35px 35px; border-width:0px; background-color:#c0c0c0;"></div></div>

<span class="bolet">Round borders: </span>
&nbsp;
horizontal top left, horizontal top right, horizontal bottom right, horizontal bottom left / 
vertical top left, vertical top right, vertical bottom right, vertical bottom left

<br /><br />

border-radius: 5px 25px 5px 25px / 5px 25px 5px 25px;
&nbsp;
border-radius: 35px 35px 35px 35px / 35px 35px 35px 35px;

</div>
  
<br />
<a href="http://azurelight.net">AzureLight.net</a> | 
<a href="http://mikaristar.deviantart.com">MikariStar.DeviantArt.com</a> | 
<a href="http://artrift.com/Mikari/">ArtRift.com/Mikari/</a> | 
<a href="http://miliazure.wordpress.com">MiliAzure.WordPress.com</a>

</div>
            
          
!
            
              body { padding:0px; margin:0px; font-family:Arial; font-size:14px; line-height:20px; 
color:#393939; background-color:#c2f0ff; text-align:center; }

::-webkit-scrollbar { width: 10px; height:10px; }
::-webkit-scrollbar-track { background-color:#c2f0ff; }
::-webkit-scrollbar-thumb { border-radius: 20px; background-color:#ff9adc; border: 0px none; }

.showbor { border:0px none; border:3px dotted #ff9adc; padding:0px; } 

a { color:#ff71ce; text-decoration:none; }
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console