Wrox Programmer Forums
| 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 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 December 30th, 2008, 11:20 AM
Registered User
 
Join Date: Dec 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question <a> element in within block-level elements?

Hello,

I'm a guy to learned a little bit of HTML a few years ago (for my degree in IT), and now am starting to transition my job into web development. I'm basically starting from scratch.

I was reading the Beginning Web Programming with HTML, XHTML, and CSS, 2nd Edition ISBN: 978-0-470-25931-3 book and page 73 gave me a head-scratcher. I'm wondering why Strict HTML 1.0 requires the <a> tag to be within a block-level element?

The reason I ask, is that if I just want to code a simple link in Strict HTML 1.0, I have to create a block-level element to encompass it? Wouldn't the block-level tag put the text in its own block of text?

Thanks in advance for some insight,
Eddie

Last edited by steddie1; December 30th, 2008 at 11:37 AM..
 
Old January 24th, 2009, 05:27 PM
Registered User
 
Join Date: Jan 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Seperation of Functionality from Style...

Eddie,

I am working through the same book and would definitely consider myself a beginner. I had seen your question after was only a few chapters in a couple of weeks back and didn't have an answer for you, but here's what I think;

I'm not sure how far you've gotten in the book since this thread was posted or if you've gotten an answer elsewhere, but the reason Srict XHTML requires the <a> tag to be within it's own block-level element has to do primarily with XHTML's new rules surrounding the use of CSS in conjunction with HTML.

The reason that the new rules differentiate heavily between the 'block-level' elements and 'inline-elements' (including the anchor tag) is the language's coding structure as it pertains to it's style. Simply put, it helps to seperate functionality code from style code, making it easier to read and protecting the integrity/life-span of the code as the language continues to evolve forward.

Hope this helps. If you've found a better answer please share, but this is how I understood it.

Cheers.
 
Old March 3rd, 2009, 04:43 AM
Registered User
 
Join Date: Mar 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default The <a> tag and why it needs to be wrapped

The <a> (anchor) tag is considered to be an inline element. This is why it needs to be wrapped in a "block level" tag such as <p>.

All inline tags should be wrapped. For a good list, you can go to http://en.wikipedia.org/wiki/HTML_element for a list of them.

Hope this helps.




Similar Threads
Thread Thread Starter Forum Replies Last Post
embedded <xsl:element> into <xsl:with-param> petergoodman XSLT 2 July 9th, 2008 06:36 AM
create <ul> with alternating class on <li> element Brian Campbell XSLT 2 November 3rd, 2006 06:07 PM
line-height -n- background-color with <DIV> block anshul HTML Code Clinic 11 September 5th, 2004 02:15 PM
putting <element> round group of same elements jefke XSLT 0 May 24th, 2004 10:18 AM
Losing parameters in <for-each> block? scuzzBot XSLT 4 September 8th, 2003 02:07 AM





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