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

              
                <!-- SIMPLE TEXT IN DIV - TABLE-CELL -->
<div class='table-cnt'>
  <div class='tbl-div'><span>It's no problem to center<br />a multiple lines of text</span></div>
</div>
<!-- SIMPLE TEXT IN DIV - FLEX -->
<div class='flex-cnt'>
  <div class='flex-div'>It's no problem to center<br />a multiple lines of text</div>
</div>
<div class='eol'></div>
<!-- SIMPLE IMAGE IN DIV - TABLE-CELL -->
<div class='table-cnt'>
  <div class='tbl-div'><span><img src='https://www.nawt.org.uk/sites/default/files/pet_cat.jpg' /></span></div>
</div>
<!-- SIMPLE IMAGE IN DIV - FLEX -->
<div class='flex-cnt'>
  <div class='flex-div'><img src='https://www.nawt.org.uk/sites/default/files/pet_cat.jpg' /></div>
</div>
<div class='eol'></div>
<!-- IMAGE BUTTON - TABLE-CELL -->
<div class='table-cnt'>
  <a href='#' class='tbl-btn'>
    <span><img src='http://forums.mp3tag.de/style_emoticons/default/mt_save.png' /></span>
    <span>Save<span>
  </a>
</div>
<!-- IMAGE BUTTON - FLEX -->
<div class='flex-cnt'>
  <a href='#' class='flex-btn'><img src='http://forums.mp3tag.de/style_emoticons/default/mt_save.png' />Save</a>
</div>
<div class='eol'></div>
<!-- IMAGE WRAPPING - TABLE-CELL -->
<div class='table-cnt'>
  <div class='wrap-tbl'>
    <span>
    <div class='wrap-cnt'>
      <img src='http://cdn.altrn.tv/icons/talking-dog-max_52880.png?width=50&height=50&mode=crop&anchor=middlecenter' />
      This content with image and text is an example of perfect centering of content inside its holder, both vertically and horizontally.
    </div>
    </span>
  </div>
</div>
<div class='flex-cnt'>
  <div class='wrap-flex'> 
    <div class='wrap-cnt'>
      <img src='http://cdn.altrn.tv/icons/talking-dog-max_52880.png?width=50&height=50&mode=crop&anchor=middlecenter' />
      This content with image and text is an example of perfect centering of content inside its holder, both vertically and horizontally.
    </div>
  </div>  
</div>
<div class='eol'></div>
<!-- VERTICAL MENU - TABLE-CELL -->
<div class='table-cnt'>
  <ul class='vmenu-tbl'>
    <li>
        <span><img src='http://fanpagelist.com/images/facebook-16x16.png' /></span>
        <span>Facebook</span>
    </li>
    <li>
        <span><img src='https://storage.googleapis.com/support-kms-prod/SNP_9B7B9323F9C58C607BB1304DF281C297E027_6072814_en_v0' /></span>
        <span>Google+</span>
    </li>
    <li>
        <span><img src='http://cdn.twitrcovers.com/wp-content/themes/twitrcovers/images/twitter-2.png' /></span>
        <span>Twitter</span>
    </li>
    <li>
        <span><img src='https://www.redditstatic.com/spreddit4.gif' /></span>
        <span>Reddit</span>
    </li>
  </ul>
</div>
<!-- VERTICAL MENU - FLEX -->
<div class='flex-cnt'>
  <ul class='vmenu-flex'>
  <li><img src='http://fanpagelist.com/images/facebook-16x16.png' />Facebook</li>
  <li><img src='https://storage.googleapis.com/support-kms-prod/SNP_9B7B9323F9C58C607BB1304DF281C297E027_6072814_en_v0' />Google+</li>
  <li><img src='http://cdn.twitrcovers.com/wp-content/themes/twitrcovers/images/twitter-2.png' />Twitter</li>
  <li><img src='https://www.redditstatic.com/spreddit4.gif' />Reddit</li>
  </ul>
</div>
<div class='eol'></div>
<!-- HORIZONTAL MENU - TABLE-CELL -->
<div class='table-cnt'>
  <ul class='hmenu-tbl'>
    <li>
      <span class='li-tbl'>
        <span><img src='http://fanpagelist.com/images/facebook-16x16.png' /></span>
        <span>Facebook</span>
      </span>
    </li>
    <li>
      <span class='li-tbl'>
        <span><img src='https://storage.googleapis.com/support-kms-prod/SNP_9B7B9323F9C58C607BB1304DF281C297E027_6072814_en_v0' /></span>
        <span>Google+</span>
      </span>
    </li>
    <li>
      <span class='li-tbl'>
        <span><img src='http://cdn.twitrcovers.com/wp-content/themes/twitrcovers/images/twitter-2.png' /></span>
        <span>Twitter</span>
      </span>
    </li>
    <li>
      <span class='li-tbl'>
        <span><img src='https://www.redditstatic.com/spreddit4.gif' /></span>
        <span>Reddit</span>
      </span>
    </li>
  </ul>
</div>
<!-- HORIZONTAL MENU - FLEX -->
<div class='flex-cnt'>
  <ul class='hmenu-flex'>
  <li><img src='http://fanpagelist.com/images/facebook-16x16.png' />Facebook</li>
  <li><img src='https://storage.googleapis.com/support-kms-prod/SNP_9B7B9323F9C58C607BB1304DF281C297E027_6072814_en_v0' />Google+</li>
  <li><img src='http://cdn.twitrcovers.com/wp-content/themes/twitrcovers/images/twitter-2.png' />Twitter</li>
  <li><img src='https://www.redditstatic.com/spreddit4.gif' />Reddit</li>
  </ul>
</div>
<div class='eol'></div>
<!-- CHECKBOXES - TABLE-CELL -->
<div class='table-cnt'>
  <div class='chkbxs-group-tbl'>
    <div class='chkbxs-tbl'><span><input type='checkbox' /></span><span>Option #1</span></div>
    <div class='chkbxs-tbl'><span><input type='checkbox' /></span><span>Option #2</span></div>
    <div class='chkbxs-tbl'><span><input type='checkbox' /></span><span>Option #3</span></div>
  </div>
</div>
<!-- CHECKBOXES - FLEX -->
<div class='flex-cnt'>
  <div class='chkbxs-group-flex'>
    <div class='chkbxs-flex'><input type='checkbox' /><span>Option #1</span></div>
    <div class='chkbxs-flex'><input type='checkbox' /><span>Option #2</span></div>
    <div class='chkbxs-flex'><input type='checkbox' /><span>Option #3</span></div>
  </div>
</div>
<div class='eol'></div>
<div class='eol'></div>
              
            
!

CSS

              
                body {
  font-size: 18px;
  margin: 24px;
}
.table-cnt {
  float: left; 
  margin: 0 60px 24px 0;
}
.flex-cnt {
  float: left; 
}
.eol {
  display: block; 
  clear: both;
  height: 32px;
}
/* SIMPLE TEXT AND IAMGE IN DIV - TABLE-CELL */
.tbl-div {
  display: table;
  width: 400px;
  height: 120px;
  background-color: #ffe6cc;
  border: solid 1px gray;
}
.tbl-div > span {
  display: table-cell;
  text-align: center;
  vertical-align: middle; 
}
/* SIMPLE TEXT AND IAMGE IN DIV - FLEX */
.flex-div {
  display: flex;
  width: 400px;
  height: 120px;
  justify-content: center;
  align-items: center;
  background-color: #f0fff0;
  border: solid 1px gray;
}
/* IMAGE BUTTON - TABLE-CELL */
.tbl-btn {
  display: table;
  color: black;
  text-decoration: none;  
  padding: 6px 24px 6px 24px;
  background-color: #ffe6cc;
  border: solid 1px lightgray; 
  border-radius: 4px;
}
.tbl-btn span  {
  display: table-cell;
  vertical-align: middle;
}
.tbl-btn img {
  float: left;
  margin-right: 6px;
}
/* IMAGE BUTTON - FLEX */
.flex-btn {
  display: flex;
  align-items: center;
  color: black;
  text-decoration: none;
  padding: 6px 24px 6px 24px;
  background-color: #f0fff0;
  border: solid 1px lightgray; 
  border-radius: 4px;
}
.flex-btn img {
  margin-right: 6px;
}
/* IMAGE WRAPPING - TABLE_CELL */
.wrap-tbl {
  display: table;
  width: 400px;
  height: 200px;
  background-color: #ffe6cc;
  border: solid 1px gray;
}
.wrap-tbl > span {
  display: table-cell;
  text-align: center;
  vertical-align: middle;  
}
/* IMAGE WRAPPING - FLEX */
.wrap-flex {
  display: flex;
  width: 400px;
  height: 200px;
  justify-content: center;
  align-items: center;
  background-color: #f0fff0;
  border: solid 1px gray;
}
.wrap-cnt {
  display: inline-block;
  width: 220px;
  font-size: 16px;
  text-align: justify; 
  padding: 12px;
  background-color: #d7ffff;
  border: solid 1px gray;  
  box-shadow: 2px 2px 8px #c0c0c0;
}
.wrap-cnt img {
  padding-right: 10px;
  float: left;
}
/* VERTICAL MENU - TABLE_CELL */
.vmenu-tbl {
  list-style: none;
  padding-left: 0;
  font-size: 15px;
}
.vmenu-tbl li {
  display: table;
  width: 100%;
  margin: 0 0 2px 0;
  padding: 4px 0 4px 8px;
  background-color: #ffe6cc;
  border: solid 1px lightgray;  
}
.vmenu-tbl span {
  display: table-cell;
  text-align: left;
  vertical-align: middle;
}
.vmenu-tbl span:first-child {
  width: 22px;
}
.vmenu-tbl img {
  float: left; 
  margin-right: 6px;
}
/* VERTICAL MENU - FLEX */
.vmenu-flex {
  list-style: none;
  padding-left: 0;
  font-size: 15px;
}
.vmenu-flex li {
  display: flex;
  align-items: center;
  padding: 4px 8px 4px 8px;
  margin-bottom: 2px;
  background-color: #f0fff0;
  border: solid 1px lightgray;
}
.vmenu-flex img {
  margin-right: 6px;
}
/* HORIZONTAL MENU - TABLE_CELL */
.hmenu-tbl {
  display: inline-block;
  list-style: none;
  padding-left: 0;
  font-size: 16px;
  border: solid 1px lightgray;
}
.hmenu-tbl li {
  float: left;
  padding: 10px 20px 10px 10px;
  background-color: #ffe6cc;
}
.li-tbl {
  display: table;
}
.li-tbl span {
  display: table-cell;
  vertical-align: middle;
  font-size: 16px;
}
.li-tbl img {
  float: left;
  margin-right: 6px;
}
/* HORIZONTAL MENU - FLEX */
.hmenu-flex {
  display: inline-block;
  list-style: none;
  padding-left: 0;
  font-size: 16px;
  border: solid 1px lightgray;
}
.hmenu-flex li {
  float: left;
  display: flex;
  align-items: center;
  padding: 10px 20px 10px 10px;
  background-color: #f0fff0;
}
.hmenu-flex img {
  margin-right: 6px;
}
/* CHECKBOXES - TABLE_CELL */
.chkbxs-group-tbl {
  display: block;
  padding: 16px 32px 16px 24px;
  background-color: #ffe6cc;
  border: solid 1px lighgray;
  border-radius: 3px;
}
.chkbxs-tbl {
  font-size: 16px;
  display: table;
  padding: 0 0 4px 0;
}
.chkbxs-tbl > span {
  display: table-cell;
  vertical-align: middle;
}
.chkbxs-tbl > span:last-child {
  padding-left: 6px;
}
/* CHECKBOXES - FLEX */
.chkbxs-group-flex {
  display: block;
  padding: 16px 32px 16px 24px;
  background-color: #f0fff0;
  border: solid 1px lightgray;
  border-radius: 3px;
}
.chkbxs-flex {
  font-size: 16px;
  display: flex;
  align-items: center;
  padding: 0 0 4px 0;
}
.chkbxs-flex > span {
  padding-left: 6px;
}
              
            
!

JS

              
                
              
            
!
999px

Console