'how give line-height to an img's alt text in CSS
i have given to all my img alt text a specific font-size, so that they can be more readable if the img doesn't get loaded. But still the line-height is still too much. i tried to decrease the line-height in the css code below, but it doesn't effect. i don't want any jQuery work-arounds. I prefere to fix it css only.
thank you.
img[alt]{
font-size: 8px;
}
Solution 1:[1]
Try this
<span style="font-size: 1.75em">
<img alt="Some Text" src="http://www.someimage.com/img/010.jpg">
</span>
Solution 2:[2]
you can use "font-size" attribute to that img tag or you can use img tag in span or div any container tag , it'll work
I've tried this one and it works fine
<span style="font-size: large;"><img alt="your text" src=""></span>
thanks :)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Sirjiskit |
Solution 2 |