Split, Fractured Text

See the Pen Strikethrough, Fractured, Split Text by Brandon Himpfen (@brandonhimpfen) on CodePen.16787

HTML

<h1 contenteditable data-heading="Split">Split</h1>

CSS

h1 {
  color: black;
}
h1::before, h1::after {
  content: attr(data-heading);
  position: absolute;
  left: 0;
  overflow: hidden;
}
h1::before {
  height: 50%;
  color: white;
  text-shadow: 3px -2px 5px white, -3px 3px 4px white;
}
h1::after {
  -webkit-transform: translateX(-10px);
          transform: translateX(-10px);
  height: 49%;
  color: black;
}

html {
  height: 100vh;
}

body {
  font-family: 'Roboto', sans-serif;
  height: 100vh;
}

h1 {
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  position: absolute;
  margin: 0;
  font-size: 10vw;
  font-weight: 900;
  text-transform: uppercase;
}

JavaScript

var h1 = document.querySelector("h1");

h1.addEventListener("input", function() {
    this.setAttribute("data-heading", this.innerText);
});

Highlight Text

See the Pen Highlight Text by Brandon Himpfen (@brandonhimpfen) on CodePen.16787

HTML

<p class="">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac <span class="highlighted">tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo</span>.</p>

CSS

html {
  font-family: Avenir, Helvetica, san-serif;
  margin: 3rem 5rem;
}
p {
  font-size: 200%;
}
.highlighted {
  background-color: yellow;  
}

Vertical Text

See the Pen Vertical Text by Brandon Himpfen (@brandonhimpfen) on CodePen.16787

HTML

<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>

CSS

html {
  font-family: Avenir, Helvetica, san-serif;
  margin: 3rem  auto;
}
p {
  writing-mode: vertical-rl;
  font-size: 200%;
  margin: auto;
}