html - Text over the top of a border-image: Using the border as an expandable background -
i'm trying create expandable background image text. border-image property gives me want. problem don't want border, more border becomes background content (specifically fixed resolution edges , stretching centre). setting height 0 gives exact background want, unfortunately text dropped below centre:
height: 0px; display: inline-block; font-size: 100pt; border: 149px; border-image: url('img.png') 149 149 stretch;
edit: firefox border: solid 149px;
- what's simplest way shift text up?
- is there simple way add negative offset width bring border sides in?
this great example believe negative padding provide perfect solution.
i'm aware there's many other ways achieve same result (eg standard background image , 2 elements either side), i'm after small , simple.
you use line-height:
http://jsfiddle.net/jonigiuro/rl798/4/
div { height: 0px; display: inline-block; font-size: 100pt; border: 149px; border-image: url('http://upload.wikimedia.org/wikipedia/commons/thumb/b/bb/button_icon_greenblue.svg/300px-button_icon_greenblue.svg.png') 149 149 stretch; line-height: 20px; }
Comments
Post a Comment