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 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 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 October 7th, 2005, 08:04 AM
Registered User
 
Join Date: Aug 2005
Location: , NJ, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default HTML tag vs Body Tag

Hi -

I'm a bit confused about creating styles that affect the outermost "wrapper" of your web page. On page 124 of the book, the HTML tag is given the style definition that causes the thick black frame around the page content. (This is done through use of the :root pseudo-class, but I'm guessing that the effect would be the same if I just referenced the HTML tag in the style definition). I would have thought that the body tag would have been the tag to reference to get this effect. (In fact, there might have been an example in the book where the body tag was used.) I think of the HTML tag as unrelated to web page display. Is there a difference between using body vs html tag? If so, can anyone tell me what?

Reply With Quote
  #2 (permalink)  
Old October 7th, 2005, 08:13 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 5 Times in 5 Posts
Default

I can't think of any differences. You have to reference the <html> tag on occaision though. For instance, if you want to set the height of the <body> element to 100% of the viewport, the <html> tag must also be set to 100%. That has to do with the shrink-to-fit height sizing algorithm specified in the CSS standards.

The :root psuedo-class isn't very useful in HTML because you *can* reference the <html> tag directly. Where it becomes useful, and the reason for it existing as far as I can tell, is in XML where the root element can be variable, and not always the same tag.

Hope that answers your question.

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
Reply With Quote
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML tag problem Aker C# 7 April 22nd, 2008 12:04 PM
HTML tag from C# or ASP.NET tag from javascript angshujit ASP.NET 2.0 Basics 3 February 16th, 2007 10:07 AM
Properties in Body Tag - Pg. 40/41 jabs BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 December 5th, 2006 09:12 AM
Evaluating body content of a custom tag Tag Librarian Pro JSP 0 May 13th, 2005 03:40 PM
body tag in an include page Adam H-W Javascript 8 April 29th, 2004 04:03 AM



All times are GMT -4. The time now is 07:18 AM.


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