Skip to content

Instantly share code, notes, and snippets.

@gunnarbittersmann
Created January 22, 2015 11:01
Show Gist options
  • Select an option

  • Save gunnarbittersmann/ca487891cca577bec0f2 to your computer and use it in GitHub Desktop.

Select an option

Save gunnarbittersmann/ca487891cca577bec0f2 to your computer and use it in GitHub Desktop.
heading with text background
/**
* heading with text background
*/
h1
{
font: normal 2.5em/1.5 Georgia, serif;
padding: 0 0.5em;
background-image: linear-gradient(
to bottom,
transparent 10%,
orange 10%,
orange 95%,
transparent 95%
);
background-size: 100% 1.5em;
overflow: hidden;
position: relative;
}
h1::after
{
content: "";
position: absolute;
background: white;
width: 100%;
height: 1.5em;
margin-left: 0.5em;
}
<h1>This is a very long heading which does not fit into a single line but spreads over multiple lines</h1>
// alert('Hello world!');
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment