Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | 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
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 7th, 2005, 07: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?

  #2 (permalink)  
Old October 7th, 2005, 07: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 6 Times in 6 Posts

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.


Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 11:04 AM
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 02:40 PM
body tag in an include page Adam H-W Javascript 8 April 29th, 2004 03:03 AM

All times are GMT -4. The time now is 04:14 PM.

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