The CSS Hack Thing


XHTML 1.0 doctype issue


CSS: padding-bottom 0px gives 5px offset

Problem: 

 The padding-bottom  0px value is ignored if the doctype is set for XHTML 1.0

leaving an approximate 5px offset. If the doctype is disabled the problem is corrected, however this is not a good fix.

I tend to use the border-collapse setting especially when bunching images in tables, however with Firefox I still got the issue and I don't want to disable the doctype.


Result: 

Two possibilities will work -


      display: block;   set against the img

      vertical-align: bottom;   set against the img


I would prefer to use the former along with the border-collapse against the table


Example layouts are shown below



image
image

1

margin 0px, spacing 0px
padding 0px, padding-bottom 0px
no border collapse
 




off
off

2

Top Edge

margin 0px, spacing 0px
padding 0px, padding-bottom 0px
border collapse on table
 

Bottom Edge



off
off

3

Top Edge

margin 0px, spacing 0px
padding 0px, padding-bottom 0px
border collapse on table
display: block;  (top image)
 

Bottom Edge



off
off

4

Top Edge

margin 0px, spacing 0px
padding 0px, padding-bottom 0px
border collapse on table
display: block;  (top image)
vertical-align: bottom;  (bottom image)
 

Bottom Edge

Please press to DISABLE the XHTML 1.0 doctype




CSS


CSS


XHTML


XHTML