See the following jsFiddle: http://jsfiddle.net/Leng/kQvNH/
Can someone explain why a significant number of additions appear on each line of horizontal dots (about 15 pixels above and 4 pixels below)? Images are only 2px tall. Where does the indentation come from?
NOTE:
For me, this mysterious padding around images only happens when I start my documents with an HTML5 header:
<!DOCTYPE html> <html>
Images are usually displayed (without filling) when I use any other header, such as HTML4 or this XHTML header for a web page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
So it looks like an HTML5 mismatch. I would like to switch to standard HTML5 headers, but this little annoyance is stopping me from doing this.
Thanks for any recommendations.
DECISION:
Here is jsFiddle with the solution: http://jsfiddle.net/Leng/Sn2PC/
img { display:block; margin:0 auto; }
This is based on Chris's answer below.
Note that setting font-size: 0 or line-height: 0 is not a solution, because it is a mess (obviously) with the font size and line height.
Again, setting the lock screen and creating an automatic field was not necessary to execute normal, centered, non-padded images in HTML4 or XHTML.
HTML5 created this “feature” where images are embedded and will be indented based on line height or font size.
source share