I want to create this effect:
Is there a way to do this via CSS/JS?
Thanks so much I'm a newbie in web design and I've been struggling with this for the past hours!
I want to create this effect:
Is there a way to do this via CSS/JS?
Thanks so much I'm a newbie in web design and I've been struggling with this for the past hours!
Here's a method of achieving a multi-line, padded, highlight behavior for text using just CSS.
This is based on the box-shadow method found elsewhere however as of Firefox 32 the traditional box-shadow solution no longer renders correctly.
Reviewing the changes made I found the addition of a new property: box-decoration-break, that was responsible. This property defaults to 'split' but needs to be specified as 'clone' to achieve the desired multiline padding effect.
For more info see: https://developer.mozilla.org/en-US/docs/Web/CSS/box-decoration-break
This can be achieved with
line-height
,padding
andbackground-color
Not sure why this is being down voted, I asked this question a couple of years ago, there is no way to do this with pure css that I am aware of but there is a plugin some one shared:
http://jsfiddle.net/OwenMelbz/rd8Qc/
Original question: Persistant padding on a text that wraps?
There is another, similar way of doing it that only requires a small amount of javascript. Similar to the answer above, but places all the styling in the CSS rather than inline elements
(Couldn't get the SO code editor to work)
http://jsbin.com/mohuti/1/edit?html,css,js,output