You are here: Re: cellpadding and cellspacing problem « HTML « IT news, forums, messages
Re: cellpadding and cellspacing problem

Posted by Jukka K. Korpela on 04/12/07 19:38

Scripsit Travis Newbury:

> On Apr 12, 8:02 am, "K." <halinaciern...@poczta.onet.pl> wrote:
>
>> I created yet unfinished pagewww.slub.zmyslowski.pl about my
>> wedding.... I used validator before->http://www.htmlvalidator.com/.
>> -> my page is
>
> Man I don't have an answer for you, but I have to give you kudos for
> doing all the prerequisite work and giving us a URL and validating
> your page first.

Well, almost giving us a URL (the http:// part is missing) and trying to
validate. Unfortunately, he used a product that is dishonestly sold as a
validator but isn't, the infamous "CSE HTML Validator". His confusion is
understandable; the phoney validator's business isn't.

In reality, the page contains dozens of syntax errors, as a real validator
like http://validator.w3.org would tell (for free). The page has a mixture
of XHTML 1.0 and HTML 4.01 syntax, and contrary to the doctype declaration,
it uses Transitional features. It should be fixed to comply with HTML 4.01
Transitional, then perhaps improved (by replacing presentational markup by
CSS) to HTML 4.01 Strict.

The problem asked is independent of these problems. As Els writes in his
reply, the gaps are caused "by the space that is below text and
inline-images, to make room for descenders of letters like g,j,p,q,y".
Setting display: block for the images is one way of fixing. Another option,
perhaps more natural, is
img { vertical-align: bottom; }

Technically, the problem is that an image is treated as a special kind of
text element, like a letter, which is by definition vertically aligned to
the _baseline_ of text. You can see this if you put an image between
letters, e.g. <p>yep<img ...>yep</p>.

This is what CSS specifications say, and Firefox obeys this, whereas IE
doesn't. But this can fixed either by making the images blocks (as far as
rendering is considered), which aren't treated as text elements, or by
explicitly setting their vertical alignment to bottom (i.e., the bottom of
the image is aligned to the bottom of the enclosing element's box).

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация