Skip to content

Instantly share code, notes, and snippets.

@jacqueminv
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save jacqueminv/56d3f603fa5760e8733a to your computer and use it in GitHub Desktop.

Select an option

Save jacqueminv/56d3f603fa5760e8733a to your computer and use it in GitHub Desktop.
Multiline text with set width and padding per line
Use the `box-shadow` property to add the padding (http://codepen.io/jacqueminv/pen/hKmdH).
HTML:
<div>
<span>A multiline text that we want to define a graphical padding per line</span>
</div>
CSS:
div {
width: 10em;
}
span {
background-color: #dd0000;
box-shadow: 1em 0 0 #dd0000,-0.5em 0 0 #dd0000;
line-height: 1.6em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment