How to insert image inside span tag?

I have an image inside a span tag. But the problem is that the image does not fit inside the span tag. Instead, part of the image exits the span tag.

enter image description here

enter image description here

<span style="padding-right:3px; padding-top: 3px;"> <img class="manImg" src="images/ico_mandatory.gif"></img> </span> 

I want to have this bar inside the range ie It should be next to the text box.

How can i achieve this?

+5
source share
2 answers

Try it.

 <span style="padding-right:3px; padding-top: 3px; display:inline-block;"> <img class="manImg" src="images/ico_mandatory.gif"></img> </span> 
+11
source

Try using the div tag and block for span!

 <div> <span style="padding-right:3px; padding-top: 3px; display:block;"> <img class="manImg" src="images/ico_mandatory.gif"></img> </span> </div> 
+1
source

Source: https://habr.com/ru/post/1208824/


All Articles