Wrox Programmer Forums
|
BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3
This is the forum to discuss the Wrox book Beginning CSS: Cascading Style Sheets for Web Design by Richard York; ISBN: 9780764576423
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 27th, 2005, 02:25 AM
Registered User
 
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Figure 4-7 on p. 64

Why does this example render differently in IE6 than in Firefox? (The boxes are centered in IE6, left-aligned in Firefox.) I thought that standards mode meant that they would render the same.

 
Old March 27th, 2005, 09:19 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

In an ideal world everything would render identically in all browsers. Here you are seeing a very old bug in Internet Explorer. Well, most developers consider it a bug, but in reality it is a feature that Microsoft developers decided on long ago. That feature is that using the text-align: center; declaration will center all text and block elements that appear as children in the containing block (in this case the containing block is the <body> element). OK, so big deal that's what's it's supposed to do, right? Wrong. According to the standards only text is supposed to be centered with the text-align property. IE also centers block elements like <div>, <form>, <h1>, etc, eventhough that isn't what the standards say to do (it is after all the text-align property). That's why Firefox, et al don't center the <div> elements in that example. For block elements you'll see how alignment of blocks is controlled in Chapter 10 with the margin property.

But you are correct in your understanding of standards mode, it is supposed to make things render more consistently with other browsers (and it helps loads), but there are still bugs to fight with in IE in standards mode (oh how there are bugs!).

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design





Similar Threads
Thread Thread Starter Forum Replies Last Post
install sql server 2005 64-bit khautinh SQL Server 2005 0 November 19th, 2008 01:43 PM
base 64 data in transform golddog XSLT 4 September 14th, 2007 08:39 AM
64 bit p0120144 BOOK: Professional Assembly Language 1 December 26th, 2006 10:04 PM
64 Bit - Issue in 64 bit IIS calling Win32 API Hubman General .NET 1 August 24th, 2006 09:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.