|
|
 |
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 computer programmers 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 programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |

December 30th, 2008, 10:20 AM
|
|
Registered User
|
|
Join Date: Dec 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
<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 10:37 AM.
|

January 24th, 2009, 04:27 PM
|
|
Registered User
|
|
Join Date: Jan 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

March 3rd, 2009, 03:43 AM
|
|
Registered User
|
|
Join Date: Mar 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |