I have a span that has no content, but i need a background image (an arrow, by the way).
The problem is without no content inside span the background doesnt appear.
How can i solve this?
Let's add a background image to the text span — this image will appear within the text: Open Style panel > Backgrounds. Click the Image and gradient "plus" icon. Click Choose Image to select the image for your text fill.
Usually span element is used to group inline elements together to implement style (using id or class attributes) or language information or JavaScript DOM(using id or class attributes), when no other element is found suitable to form that group. 3. The element can contain a piece of text or an image directly.
To make a background image not repeat in HTML, specify no-repeat in the background-repeat property or the background shorthand property. The background image is set to 'no-repeat' using the 'background-repeat' property. The above example uses the background-repeat property to set the image to no-repeat .
Set the width; and height properties of the span.
<span style="width: 90px; height: 90px; background-image: url('bg.jpg'); display:block" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With