SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 43
  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,147
    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
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,596
    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.
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  6. #6
    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.

  7. #7
    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.

  8. #8
    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

  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 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

  10. #10
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,596
    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.
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  11. #11
    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

  12. #12
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,596
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by co.ador View Post
    What would be a well formed way to do it in a xhtml so it does validate?
    As posted above, your option 2.
    what do you mean when you say;
    Code:
    <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>
    You that code. That is a part of a table so as such, you should only have tables if you have tabular data. If this IS tabular data you are fine, if not try and restructure the site to not use tables as they were not meant for that purpose.
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  13. #13
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lol, I asked you the wrong question,

    what I meant to ask was

    what is tabular data?

  14. #14
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,596
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  15. #15
    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....

  16. #16
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,596
    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 .
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  17. #17
    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 co.ador View Post
    What would be a well formed way to do it in a xhtml so it does validate?

    what do you mean when you say;
    @co.ador
    The example Ryan and I provided is the well formed way, excluding what html5 may say

    The table element represents data with more than one dimension, in the form of a table.

  18. #18
    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

  19. #19
    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

  20. #20
    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
    Valid markup and well formed markup go hand in hand I believe.
    Not really.

    In XML, valid markup is always also well-formed. But well-formed markup is not necessarily valid. As an example, in XHTML, <div><span/></div> is valid and well-formed, while <span><div/></span> is well-formed but not valid.

    HTML does not have the concept of well-formedness, but does have the concept of validity. <div><span></span></div> is valid, <span><div></div></span> is not.
    Simon Pieters

  21. #21
    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
    Not really.
    In XML, valid markup is always also well-formed. But well-formed markup is not necessarily valid. As an example, in XHTML, <div><span/></div> is valid and well-formed, while <span><div/></span> is well-formed but not valid.
    <span><div/></span> is well-formed as far as consistency claims it to be.
    http://en.wikipedia.org/wiki/Well-formed_element

    Quote Originally Posted by zcorpan View Post
    HTML does not have the concept of well-formedness, but does have the concept of validity. <div><span></span></div> is valid, <span><div></div></span> is not.
    I never said the html validator was perfect
    It does check for well formed elements(that are embedded correctly according to the html standards), thus making it valid or invalid.

  22. #22
    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
    <span><div/></span> is well-formed as far as consistency claims it to be.
    Not sure what you mean here. But yes, it's well-formed -- that's what I said.

    Quote Originally Posted by cooper.semantics View Post
    Wikipedia is hardly an authoritative source for XML terminology. For starters, the XML spec does not talk about well-formed elements but well-formed documents (and well-formed parsed entities).

    Quote Originally Posted by cooper.semantics View Post
    I never said the html validator was perfect
    I didn't make any statements about the html validator, so I'm not sure how that's relevant.
    Quote Originally Posted by cooper.semantics View Post
    It does check for well formed elements(that are embedded correctly according to the html standards), thus making it valid or invalid.
    It seems you still don't understand the difference between well-formed and valid.

    Whether elements are embedded correctly according to the html standards affects what is considered valid, but not what is considered well-formed.

    The validator checks for well-formedness for XML documents (i.e. that the document follows the XML syntax), and also checks that elements are nested correctly according to the DTD (i.e. that it's valid).
    Simon Pieters

  23. #23
    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
    I didn't make any statements about the html validator, so I'm not sure how that's relevant.
    It seems you still don't understand the difference between well-formed and valid.

    Whether elements are embedded correctly according to the html standards affects what is considered valid, but not what is considered well-formed.

    The validator checks for well-formedness for XML documents (i.e. that the document follows the XML syntax), and also checks that elements are nested correctly according to the DTD (i.e. that it's valid).
    I do understand, you are not understanding what I am saying
    I was thinking out loud with that statement(html validator), so sorry wasn't implying that you said anything...

    What I said. It checks for well formed elements e.g.:
    <div><span></span></div>
    <h1><span></span></h1>

    But even though this might be well formed:
    <span><div></div></span>

    It won't validate because html states that a inline element may not wrap a block level element.

  24. #24
    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
    I do understand, you are not understanding what I am saying
    Ok, fair enough.
    Simon Pieters

  25. #25
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what are the result of a well-formed element not necessary valid in a browser? it affect the display of a file on the browser?


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
  •