SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 43

Hybrid View

  1. #1
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What is the correct way to locate a link <a></a>

    Outside the tags like this:


    HTML Code:
    <td width="152" rowspan="2" class="cebo"><a href="#"><h3 align="center"> coloso</h3></a>                        
    <a href="#"><p><img src="../images/chefrecommendation.jpg" width="140" height="160" alt="product" style=" border-color:#FF6600; border:thin; border-style:solid;"/></p></a></td>

    Or Inside the tags like this:

    HTML Code:
    <td width="152" rowspan="2" class="cebo"><h3 align="center"> <a href="#">coloso</a>   </h3>                     
    <p><a href="#"><img src="../images/chefrecommendation.jpg" width="140" height="160" alt="product" style=" border-color:#FF6600; border:thin; border-style:solid;"/></a></p></td>

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,146
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)

  3. #3
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The latter of these two. The former is not well formed and won't validate.

  4. #4
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you guys,

    Hey Oddz that a very good tool you have just shown me.. Thank you for helping me I am just trying to cut up a 8 years semi starvation in the US. Lol.

  5. #5
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    The former is not well formed
    How is it not well-formed?
    Simon Pieters

  6. #6
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan View Post
    How is it not well-formed?
    Wrapping an anchor around a block level element in xhtml doesn't validate. It might be well formed in html5

  7. #7
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by co.ador View Post
    So the second way it's the most advisible ok.
    Yes, and the only valid way to do this..as of now.

    Quote Originally Posted by cooper.semantics View Post
    Wrapping an anchor around a block level element in xhtml doesn't validate. It might be well formed in html5
    From what I have seen from the HTML5 spec, it will be well formed.
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  8. #8
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What would be a well formed way to do it in a xhtml so it does validate?

    what do you mean when you say;

    if this content is describing tabular data it is fine

  9. #9
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    Yes, and the only valid way to do this..as of now.



    From what I have seen from the HTML5 spec, it will be well formed.
    Yep... Thanks to Eric Meyer for proposing this to Bruce Lawson....

  10. #10
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    Wrapping an anchor around a block level element in xhtml doesn't validate.
    Valid and well-formed are different concepts. Well-formedness is an XML concept. The two examples in the first post are both well-formed (assuming they are placed in another element).
    Simon Pieters

  11. #11
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan View Post
    Valid and well-formed are different concepts. Well-formedness is an XML concept. The two examples in the first post are both well-formed (assuming they are placed in another element).
    Valid markup and well formed markup go hand in hand I believe. A few different concepts are derived from xml.

    The w3c html validator checks for well formed markup.

    Seasoned, able professionals will take pride in creating Web content using semantic and well-formed markup, separation of style and content, etc. Validation can then be used as a quick check to determine whether the code is the clean work of a seasoned HTML author, or quickly hacked-together tag soup.
    Interesting article:
    http://adrianba.net/archive/2008/11/...d-mark-up.aspx

  12. #12
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    Wrapping an anchor around a block level element in xhtml doesn't validate. It might be well formed in html5
    Just a slight correction. "Well formed" is an XML concept; you could apply it to XHTML5 but not HTML5. HTML5 speaks of "conformance," so well-formedness from XML would be conformity, so possibly "conformal" would be the equivalent term for "well formed."

  13. #13
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Arlen View Post
    Just a slight correction. "Well formed" is an XML concept; you could apply it to XHTML5 but not HTML5.
    So you're saying you can only consider things well-formed in xhtml and not html?

  14. #14
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    The first doesn't work (or shouldn't) is because you wrap a block element inside of an inline element. The anchor tag is an inline element and as such can only hold inline elements. Even if you give the anchor display:block; all it does is generate a block box. It doesn't make it valid.
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  15. #15
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So the second way it's the most advisible ok.

  16. #16
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code HTML4Strict:
    <td rowspan="2" class="cebo">
    	<h3><a href="#">coloso</a></h3>                     
    	<p><a href="#"><img src="../images/chefrecommendation.jpg" width="140" height="160" alt="product" /></a></p>
    </td>

    If this content is describing tabular data it is fine. Make sure you move all inline styles into a stylesheet.

  17. #17
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  18. #18
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Well hopefully he can work in enough time to write the CSS3 inline model draft. It looks interesting.

    With inline elements being able to handle blocks inside of it we could write dropdowns that work in IE6 without JS, though a little too late for this type of thing though it's ironic .
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  19. #19
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    If an element is well formed AND valid it won't have any weird effects, just whatever you code on itt.

    If you have a well formed element and it ISN'T valid, there is no telling what will happen-with invalid code you can't expect valid results

    If you have a non well formed element and ISN'T valid you are just asking for trouble. No telling what will happen.

    If you have a non well formed element and IS valid still no tellinng what will happen.
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  20. #20
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have determined that it is preferred to have it well formed and valid as well.

    understood...

    Thank you guys

  21. #21
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    If you have a well formed element and it ISN'T valid, there is no telling what will happen-with invalid code you can't expect valid results
    It depends on whether the spec defines what should happen or not. XHTML 1.0 does not say what should happen, while e.g. SVG 1.2 and XHTML5 do say what should happen.

    Quote Originally Posted by RyanReese View Post
    If you have a non well formed element and ISN'T valid you are just asking for trouble. No telling what will happen.
    The XML spec says that the parser will abort.

    Quote Originally Posted by RyanReese View Post
    If you have a non well formed element and IS valid still no tellinng what will happen.
    This cannot happen by definition.
    Simon Pieters

  22. #22
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wink

    I think because you want to use the term doesn't mean you should.

    That page doesn't contradict a single word I wrote. It speaks of well-formedness as an xml concept and applies it to an older version of HTML. In short, it says the same thing I said.

    If you want to extend the practice to HTML5, then you're simply writing "bilingual" XHTML5 (sorry I'm blanking on the official term for it, but I'm after the flavor of HTML5 that can be served with either xml or html mime types). Well-formed still doesn't apply to vanilla HTML5.

  23. #23
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    quirksmode.org isn't authoritative, either, sorry.

    Even if it is a widely spread misconception that well-formedness is a concept that can be applied to HTML or SGML, it is not technically correct. The SGML and HTML specs do not define such a concept. (Try searching for "well-formed" in http://www.w3.org/TR/html4/html40.txt )

    Quote Originally Posted by Arlen View Post
    I said "well-formedness was an XML concept," when, if I were to be absolutely and universally precise I should have said, "well-formedness is a concept XML inherited from SGML."
    No. It's a concept that XML invented. (It was invented in order to support DTDless parsing.)

    In SGML, a document instance is either valid (according to its DTD and SGML declaration), or it is not.

    As I said earlier, there is the concept of "well-formed XML documents", defined here:
    http://www.w3.org/TR/REC-xml/#sec-well-formed

    ...and "well-formed parsed entity", defined here:
    http://www.w3.org/TR/REC-xml/#wf-entities

    To confuse things more, there's also the concept of namespace-well-formed documents, which is defined in the Namespaces in XML spec.
    http://www.w3.org/TR/REC-xml-names/#dt-nwf
    Simon Pieters

  24. #24
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @zcorpan

    I am one of those believers that believes well-formed html is xml.

    The references I posted I am in agreeance with.

    If you can provide a statement from the w3c that says "well-formed html isn't xml", or something similiar to that, then I will change my mind.

  25. #25
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    @zcorpan

    I am one of those believers that believes well-formed html is xml.
    What do you mean with "well-formed html"?

    Do you mean something along the lines of "If I take this HTML document, interpret it as XML, and it's well-formed, then I'll say that it's XML."?

    Do you similarly believe that "well-formed plain text" is XML?

    Would your belief be reflected in whether you would parse content labeled as HTML with an XML parser if you were to write software that consumes XML?
    Simon Pieters


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •