Skip to content

Instantly share code, notes, and snippets.

@fovoc
Forked from anonymous/double-line-subtitles.markdown
Last active May 24, 2017 11:49
Show Gist options
  • Save fovoc/412345656b5033bdd2b1d79e3afc8ad6 to your computer and use it in GitHub Desktop.
Save fovoc/412345656b5033bdd2b1d79e3afc8ad6 to your computer and use it in GitHub Desktop.
Double Line Subtitles
<article>
<h1>Main Title</h1>
<p class="subtitle fancy"><span>A fancy subtitle</span></p>
</article>
@import url(https://fonts.googleapis.com/css?family=Cinzel+Decorative:400,900);
body {
font-family: 'Cinzel Decorative', cursive;
background: black;
background-size: cover;
color: white;
}
h1 {
font-size: 3em;
text-align: center;
}
article {
max-width: 600px;
overflow: hidden;
margin: 0 auto 50px;
}
.subtitle {
margin: 0 0 2em 0;
}
.fancy {
line-height: 0.5;
text-align: center;
}
.fancy span {
display: inline-block;
position: relative;
}
.fancy span:before,
.fancy span:after {
content: "";
position: absolute;
height: 5px;
border-bottom: 1px solid white;
border-top: 1px solid white;
top: 0;
width: 600px;
}
.fancy span:before {
right: 100%;
margin-right: 15px;
}
.fancy span:after {
left: 100%;
margin-left: 15px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment