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 class="left">
	<h2>Left floating column</h2>
        <legend>Apply there &rarr;&nbsp;</legend>
        <label><input type="radio" name="style" onclick="fix('')" checked>Nothing</label>
        <label><input type="radio" name="style" onclick="fix('clearfix')">Clearfix</label>
        <label><input type="radio" name="style" onclick="fix('overflow')">overflow:hidden</label>
        <label><input type="radio" name="style" onclick="fix('table')">display:table</label>
        <label><input type="radio" name="style" onclick="fix('new_context')">Display:table with width hack</label>
        <label><input type="radio" name="style" onclick="fix('column')">Column-count:1</label>
        <label><input type="radio" name="style" onclick="fix('flow-root')">Display:flow-root</label>
<div class="center" id="column">
	<div class="date">24.01.2017</div>
	<p>Below comes an image with float:left</p>
	<img src="http://css-live.ru/Primer/new-clearfix/img.jpg" class="float-left">
	<p class="clear-both">And this paragraph belongs to the main column and has clear:both;</p>
	<p>And another floating img below</p>
	<img src="http://css-live.ru/Primer/new-clearfix/img.jpg" class="float-left" style="margin-bottom: 5px;">
	<div class="absolute">Abs block</div>
              * { margin: 0; padding: 0;}

body { margin: 100px;}

/* Общие стили */
.left {
	float: left;
	width: 200px;
	background: #FC6;
	position: relative;
	z-index: 1;

label { display: block;}
h2 { margin-top: 10px;}
.float-left { float: left;}
.clear-both { 
	font-size: 15px; 
	clear: both; 
	background: #F99;
.date { 
	font-size: 20px;
	float: right;
	background: #FC0;
	padding: 2px 5px;
	margin: -10px -5px 0 0;
.absolute {
	position: absolute;
	bottom: -25px;
	right: 10px;
	width: 50px;
	height: 50px;
	background: white;
	border: 2px solid black;

.center {background: #E76D13; position: relative; padding: 0 10px;}
.clearfix:after {
    content: "";
    display: block;
    clear: both;

.overflow {
    overflow: hidden;

.table {
	display: table; 

.new_context {
    display: table;

.new_context:after {
	content: '1 1';
	display: block;
  overflow: hidden;
  height: 0;
	word-spacing: 99in; /* emulates wide text in the table */

.column {
  -webkit-column-count: 1;
  -moz-column-count: 1;
  column-count: 1;

.flow-root {
    display: flow-root;
              function fix(zzz) {
    document.getElementById('column').className = 'center '+zzz;
Loading ..................