Skip to content

Instantly share code, notes, and snippets.

@jzntam
Last active August 29, 2015 14:11
Show Gist options
  • Save jzntam/799a8dd7f6e29c6a81b3 to your computer and use it in GitHub Desktop.
Save jzntam/799a8dd7f6e29c6a81b3 to your computer and use it in GitHub Desktop.
HTML - Line Behind Text

Inside the <h1> tags wrap the title text with a span

<h1>
  <span>TITLE</span>
</h1>

Add the following to the css file. Set the same background color or image as the body or container

h1 span {
  background: #FFFFFF;
  padding: 0 20px;
  text-align : center;
}

Set the colour for the border rule

h1+* {
  border-top: solid 2px #adac97;
  padding-top: 28px;
  margin-top: -28px;
}

all credit goes to sabareesh and http://knackforge.com/blog/sabareesh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment