Wrox Programmer Forums
|
BOOK: Beginning Web Programming with HTML, XHTML, and CSS, 2nd Edition ISBN: 978-0-470-25931-3
This is the forum to discuss the Wrox book Beginning Web Programming with HTML, XHTML, and CSS, 2nd Edition by Jon Duckett; ISBN: 9780470259313
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Web Programming with HTML, XHTML, and CSS, 2nd Edition ISBN: 978-0-470-25931-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 July 26th, 2011, 10:29 AM
Registered User
 
Join Date: Jul 2011
Posts: 4
Thanks: 3
Thanked 0 Times in 0 Posts
Default How is this possible????

I am an HTML beginner. This is code I have typed, just to check what the output is, and surprisingly even though I have closed the <html> tag with the </html> tag before the <body>, the <body> is still being executed. How is this possible???? Can anyone offer some explanation??? Thanks.
Code:
<html>
</html>
<body bgcolor = "RED" text = "WHITE">
HI!!!!!
</body>
 
Old July 26th, 2011, 06:25 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

HTML is not a strict, compiled language. Even with errors in the file, the browser will try to do its best and figure out what you tried to accomplish. Although this may sound useful, it's actually quite problematic as it's harder to find issues like these. Even worse, different browsers are likely to respond differently to errors like these. Therefore, it's always a good idea to let a tool (such as the one from the W3C site) validate your HTML.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Ashu2912 (July 30th, 2011)









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