Jump to content

Image space added in HTML 5 encoding, but not in XHTML 1.0 Transitional


LambdaEnt

Recommended Posts

Unwanted space is added between images when HTML 5 encoding is specified in header:

<!doctype html>

 

but not when XHTML 1.0 Transitional is:

<!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">

 

The ONLY difference in the code is the header HTML specification.

I am using SSI via SHTML.

 

Note the spacing of the images on the right panel, as well as the space added under the image at the top left.

 

This one is XHTML 1.0 and what I want out to look like:

http://www.wordsforall.org/12/pages/1/a.shtml

post-198355-0-94050300-1459788654_thumb.jpg

 

This one is HTML 5:

http://www.wordsforall.org/12/pages/2/a.shtml

post-198355-0-55179400-1459788659_thumb.jpg

 

Any suggestions? Thank you!

Edited by LambdaEnt
Link to comment
Share on other sites

In XHTML transitional the browser runs in "almost standards" mode. This mode behave almost exactly like standards compliant mode, except that images inside table cells have the space below them stripped. You can correct this with CSS by setting the image's vertical-align property to "middle".

 

Your page takes a really long time to load. If you want your page to load faster you're going to have to resize all those image files in an image editor to make them as small as they display on the page.

 

You should consider fixing all validation errors given by the W3C validator: https://validator.w3.org/

Link to comment
Share on other sites

Just use a CSS selector that can target those images ( table img would probably work) and then set their vertical-align property to "middle".

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...