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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <h1>My personal take on how to style half of a character</h1>
 <p>Taken from this post: <a href="http://stackoverflow.com/questions/23569441/is-it-possible-to-apply-css-to-half-of-a-character" target="_blank">Is it possible to apply CSS to half of a character?</a></p>
<hr>
<span class="half-character"></span>
<div class="notes">
  <h3>Personal notes:</h3>
  <ul>
    <li>The main reason I did this was to test myself and see if I was able to accomplish styling half of a character while actually providing a meaningful answer to the OP.</li>
    <li>I am aware that this is not an ideal or the most scalable solution and the solutions proposed by the people in the post are far better for "real world" scenarios.</li>
    <li>The CSS code I created is based on the first thoughts that came to my mind and my own personal approach to the problem.</li>
    <li>My solution only works on symmetrical characters, like X, A, O, M. ** It does not work for asymmetrical chracters like B, C, F, K or lower case letters.</li>
    <li><strong>** HOWEVER</strong>, this approach creates very interesting 'shapes' with asymmetrical characters. Try changing the X to a K or to a lower case letter like an <em>h</em> or a <em>p</em> in the CSS :)</li>
  </ul>
</div>
<hr>
<p>Created by <a href="http://ricardozea.me/" target="_blank">Ricardo Zea</a></p>
<time datetime="5-16-2014">Created on: April, 2014</time>
              
            
!

CSS

              
                .half-character {
    display: inline-block;
    font: bold 350px/0.8 Arial;
    position: relative;
    &:before,
    &:after {
        content: "X"; //Change character here
        display: inline-block;
        width: 49%;
        overflow: hidden;
        color: #7db9e8;
    }
    &:after {
        position: absolute;
        top: 0;
        left: 49%;
        color: #1e5799;
        transform: rotatey(-180deg);
    }
}

/*Styling stuff, not needed for demo*/
.half-character,
.notes {
    text-align: left;
}
h1 {
    text-transform: capitalize;
}
time {
    font-size: 11px;
    color: rgba(white, 0.2);
}
.notes {
    width: 80%;
    margin: 50px auto 0;
    padding: 10px 20px;
    background: rgba(black, 0.15);
    font-size: 0.9em;
}
.new-window {
    position: relative;
    padding-right: 16px;
    &:after {
        content: "";
        display: block;
        width: 14px;
        height: 12px;
        position: absolute;
        top: 10%;
        right: 0;
        background: url(https://i.stack.imgur.com/3H2PQ.png) no-repeat;
    }
}

              
            
!

JS

              
                //Add a title to the links that open in a new tab/window
$("a[target='_blank']").attr({title:'Opens in a new tab/window'}).addClass('new-window');
              
            
!
999px

Console