Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force Firefox to render empty image within dimensions specified by CSS

Tags:

html

css

image

alt

All major browsers except FF render images with invalid src attribute within it's dimensions as specified by CSS or by width / height attributes. Only FF will render the alt attribute as it were text node, ignoring dimensions, which breaks layout in many cases.

Is there a way to force FF to render image within specified dimensions?

like image 464
cincplug Avatar asked Jan 18 '13 09:01

cincplug


1 Answers

You should change the DOM element representation

img{
 display:block;
}

or

img{
 display:inline-block;
}

or

img{
 float:left;
}
like image 196
Moguha Avatar answered Sep 27 '22 18:09

Moguha