Recent Posts
- (02/24) Calling an Element from a Helper TAGS:CakephpWeb ProgrammingUsageTutorialExample
- (10/14) Forcing A Single Join in CakePHP PaginationTAGS:CakephpCakephp 13DatabaseErrorsHabtmMysqlMssqlWeb ProgrammingUsage
- (08/11) Inserting NOW() into MySQL Using CakePHPTAGS:CakephpDatabaseMysqlMssqlWeb ProgrammingUsage
- (08/07) Best PaginateCount for CakePHP - with Group By SupportTAGS:CakephpBehaviorsWeb ProgrammingUsageDatabaseExampleMysqlHabtmHack
- (04/03) CakePHP Error Messages Not Showing on FormTAGS:CakephpCakephp 13Web ProgrammingErrorsUsage
- (02/06) Sorting Paginated Results Using a Related Model Field in CakePHPTAGS:CakephpWeb ProgrammingUsageExample
- (11/02) Changing CakePHP's Model useTable on the FlyTAGS:CakephpWeb ProgrammingMysqlDatabaseExampleTutorial
- (10/18) The Funniest Error Message Ever - Thank You EclipseTAGS:EclipseWeb ProgrammingErrorsHumorWindowsUsageSoftwarePhpCakephp
Subscribe to my feed
MainelyDesign.com Blog
Phantom Whitespace Below Img in Firefox
Posted on 07/22/2009 at 10:24 am by Kevin Wentworth
Viewed 1,930 times | 0 comments
I've come across this thing a few times before- there's a strange space below images in Firefox, but not in IE. I finally found a nice explanation as to why it happens, which I wanted to post here.
Images are displayed inline by default. When you are using an image as a block (like when you want an image to take up the entire top half of a page) you'll get some mysterious white space below the image, but only in Firefox. For once, IE actually seems to render the CSS appropriately.
The fix is simple
Add a display block to your CSS declaration for the img tag. Now, your image will display as a block without any phantom whitespace underneath the image.
- div#inside img {
- display: block;
- }
Another solution was to set the baseline to bottom, but I think setting the image to block is much more elegant, plus its semantically correct.
- div#inside img {
- vertical-align: bottom;
- }
Cheers,
-Kevin Wentworth
Tags for Phantom Whitespace Below Img in Firefox
Css | Hack | Firefox | Web Design
Comments for this Posting
No comments. Be the first to post a reply.
Sorry, comments are closed for this posting.
Please Email Kevin if you have any questions. Thanks!
