123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <h1>Stand by me</h1>
<p>Several ways to display two blocks side by side, one of which is fixed and the other fluid.</p>

<h2>float method</h2>
<p>needs Block Formatting Context</p>
<section class="float-method">
  <aside>Hi ! I'm Aside, have a 200px width and 1em right margin</aside>
  <div class="main">Lorem Elsass ipsum lacus leverwurscht Wurschtsalad mamsell Gal. gewurztraminer turpis, suspendisse commodo Oberschaeffolsheim ornare aliquam semper Miss Dahlias Mauris turpis sagittis kuglopf eleifend dignissim baeckeoffe geht's schnaps ante et sit leo schpeck sit Salu bissame</div>
</section>

<h2>inline-block method</h2>
<p>needs calc() and whitespace fixing</p>
<section class="inbl-method">
  <aside>Hi ! I'm Aside, have a 200px width and 1em right margin</aside>
  <div class="main">Lorem Elsass ipsum lacus leverwurscht Wurschtsalad mamsell Gal. gewurztraminer turpis, suspendisse commodo Oberschaeffolsheim ornare aliquam semper Miss Dahlias Mauris turpis sagittis kuglopf eleifend dignissim baeckeoffe geht's schnaps ante et sit leo schpeck sit Salu bissame</div>
</section>

<h2>table-cell method</h2>
<p>needs overall container and border-spacing</p>
<section class="table-method">
  <div class="container">
    <aside>Hi ! I'm Aside, have a 200px width and 1em right margin</aside>
    <div class="main">Lorem Elsass ipsum lacus leverwurscht Wurschtsalad mamsell Gal. gewurztraminer turpis, suspendisse commodo Oberschaeffolsheim ornare aliquam semper Miss Dahlias Mauris turpis sagittis kuglopf eleifend dignissim baeckeoffe geht's schnaps ante et sit leo schpeck sit Salu bissame</div>
   </div>
</section>

<h2>flexbox method</h2>
<p>needs&hellip; <a href="http://www.alsacreations.com/tuto/lire/1493-css3-flexbox-layout-module.html" hreflang="fr">IE10</a></p>
<section class="flex-method">
  <aside>Hi ! I'm Aside, have a 200px width and 1em right margin</aside>
  <div class="main">Lorem Elsass ipsum lacus leverwurscht Wurschtsalad mamsell Gal. gewurztraminer turpis, suspendisse commodo Oberschaeffolsheim ornare aliquam semper Miss Dahlias Mauris turpis sagittis kuglopf eleifend dignissim baeckeoffe geht's schnaps ante et sit leo schpeck sit Salu bissame</div>
</section>

<h2>grid layout method</h2>
<p>needs&hellip; <a href="https://www.alsacreations.com/article/lire/1388-CSS3-Grid-Layout.html" hreflang="fr">IE10</a> and <a href="https://www.alsacreations.com/tuto/lire/1771-css-grid-layout-en-production.html">Autoprefixer</a></p>
<section class="grid-method">
  <aside>Hi ! I'm Aside, have a 200px width and 1em right margin</aside>
  <div class="main">Lorem Elsass ipsum lacus leverwurscht Wurschtsalad mamsell Gal. gewurztraminer turpis, suspendisse commodo Oberschaeffolsheim ornare aliquam semper Miss Dahlias Mauris turpis sagittis kuglopf eleifend dignissim baeckeoffe geht's schnaps ante et sit leo schpeck sit Salu bissame</div>
</section>
            
          
!
            
              /* Common styles */
aside {
  width: 200px;
  margin-right: 1em;
}

/* Float method */
.float-method {
  overflow: hidden; /* BFC */
}
.float-method > aside {
  float: left;
}
.float-method > .main {
  overflow: hidden; /* BFC */
}

/* inline-block method */
.inbl-method {
  font-size: 0; /* whitespace fix */
}
.inbl-method > * {
  display: inline-block;
  vertical-align: top;
  font-size: 1.1rem; /* whitespace fix */
}
.inbl-method > .main {
  width: calc(100% - 200px - 1em);
}

/* Table method */
.table-method {
  overflow: hidden;
}
.table-method > .container {
  display: table;
  table-layout: fixed;
  border-spacing: 1em 0;
  margin-left: -1em;
  margin-right: -1em;
}
.table-method > .container > * {
  display: table-cell;
}

/* Flexbox method */
.flex-method {
  display: flex;
  align-items: flex-start;
}
.flex-method > .main {
  flex: 1 1 0%;
}

/* Grid Layout method */
.grid-method {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-gap: 1em;
  align-items: start;
}



/* Decoration */

* {
  box-sizing: border-box;
}
div {
  word-wrap: break-word;
}
body {
	margin: 0;
  padding: 1em;
	font-family: "Century Gothic", helvetica, arial, sans-serif;
	font-size: 1.1em;
}
section,
aside,
.main {
  border-radius: 4px;
  color: #fff;
}
section {
  background: beige;
}
aside {
  padding: 5px;
	background: hotpink;
}
.main {
  padding: 5px;
	background: dodgerblue;
}
h1 {
	margin: 1em 0 0;
	color: #345;
	text-align: center;
  font-family: georgia, "trebuchet ms", arial, serif;
}
h2 {
	margin: 1.5em 0 0;
	color: #345;
	text-align: center;
  font-family: georgia, "trebuchet ms", arial, serif;
}
body > p {
  text-align: center;
  margin-top: 0;
  color: #777;
}
a {
  color: inherit;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console