Last active
August 29, 2015 14:01
-
-
Save jacqueminv/56d3f603fa5760e8733a to your computer and use it in GitHub Desktop.
Multiline text with set width and padding per line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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