Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 26th, 2011, 11: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>
Reply With Quote
  #2 (permalink)  
Old July 26th, 2011, 07:25 PM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,960
Thanks: 79
Thanked 1,559 Times in 1,536 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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
Ashu2912 (July 30th, 2011)
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off



All times are GMT -4. The time now is 09:15 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.