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

              
                <div id="center">
  <h2>text-align-last: center;</h2>
  <h3>applied to entire div</h3>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium veniam soluta reiciendis iure molestiae perspiciatis ut magnam est nemo, quidem, esse, officia mollitia voluptate. Aspernatur rerum omnis similique repudiandae eos.</p>
  <p>Deleniti soluta laboriosam quidem quia perferendis, beatae quisquam consectetur veritatis, dicta porro, molestias nulla illo doloremque quos, recusandae voluptatibus cupiditate repellendus cumque rem. Nesciunt cum nobis ipsum qui, odit eos.</p>
  <p>Dolor perspiciatis recusandae accusantium quam doloremque placeat repellendus nemo libero, non a sit iste aspernatur, ex, numquam commodi distinctio laboriosam aperiam! Labore nam repudiandae ut, dolor facere ipsum numquam enim.</p>
  <p>Maxime eum esse repellendus fuga, culpa sapiente mollitia architecto odit, ipsam voluptatem. Perspiciatis voluptate illum exercitationem, inventore labore vero consequatur dolorem fuga, nihil. Amet, laudantium, delectus. Id, eligendi inventore eum.</p>
  <p>Unde fugiat, ab facilis porro quidem voluptatem mollitia doloremque! Obcaecati aspernatur esse, excepturi perferendis? Vero ex, rem unde id? Vel quasi quo aperiam. Dolor distinctio assumenda, quaerat nam delectus culpa.</p>
</div>

<div id="center-last">
  <h2>text-align-last: center;</h2>
  <h3>on :last-child only</h3>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium veniam soluta reiciendis iure molestiae perspiciatis ut magnam est nemo, quidem, esse, officia mollitia voluptate. Aspernatur rerum omnis similique repudiandae eos.</p>
  <p>Deleniti soluta laboriosam quidem quia perferendis, beatae quisquam consectetur veritatis, dicta porro, molestias nulla illo doloremque quos, recusandae voluptatibus cupiditate repellendus cumque rem. Nesciunt cum nobis ipsum qui, odit eos.</p>
  <p>Dolor perspiciatis recusandae accusantium quam doloremque placeat repellendus nemo libero, non a sit iste aspernatur, ex, numquam commodi distinctio laboriosam aperiam! Labore nam repudiandae ut, dolor facere ipsum numquam enim.</p>
  <p>Maxime eum esse repellendus fuga, culpa sapiente mollitia architecto odit, ipsam voluptatem. Perspiciatis voluptate illum exercitationem, inventore labore vero consequatur dolorem fuga, nihil. Amet, laudantium, delectus. Id, eligendi inventore eum.</p>
  <p>Unde fugiat, ab facilis porro quidem voluptatem mollitia doloremque! Obcaecati aspernatur esse, excepturi perferendis? Vero ex, rem unde id? Vel quasi quo aperiam. Dolor distinctio assumenda, quaerat nam delectus culpa.</p>
</div>
              
            
!

CSS

              
                #center, #center-last {
  float: left;
  width: 40%;
  padding: 2%;
  margin-right: 1%;
  line-height: 1.2;
  border: 5px solid #E18728;
  text-align: justify;
}

#center {
  -ms-text-align-last: center;
  -moz-text-align-last: center;
  text-align-last: center;
}

#center-last p:last-child {
   -ms-text-align-last: center;
  -moz-text-align-last: center;
  text-align-last: center;

}

/* styling for Pen, unrelated to text-align-last */

body {
  width: 90%;
  margin: 1em auto;
  font-family: sans-serif;
}

h2, h3 { text-align: center; }
              
            
!

JS

              
                
              
            
!
999px

Console