SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2010
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need some help with xhtml validation

    still learning the ropes of xhtml/css and I'm running into some validation issues, but I'm not quite sure how to fix them..I'm hoping someone might be able to lend a hand.

    the URL in question is:
    http://www.pazrt.com/index.html

    pretty much every page that actually has content has errors..a lot of them seem to be from the navigation.

    here's an example of the index page through an xhtml validator:
    http://validator.w3.org/check?uri=ht...Inline&group=0

    thanks again,
    Andrew

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,615
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    You're not closing various tags, and that is throwing a lot of the errors. Each opening tag must have a closing tag.

    Also, that's the most bizarre use of IE conditionals I've come across. Typically, conditionals tend only to be used with CSS, not for HTML structure or semantics.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2010
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Force Flow View Post
    You're not closing various tags, and that is throwing a lot of the errors. Each opening tag must have a closing tag.

    Also, that's the most bizarre use of IE conditionals I've come across. Typically, conditionals tend only to be used with CSS, not for HTML structure or semantics.
    I did see I missed a </li> in the navigation bar so I fixed that up and it went from 12 errors on the index page to 6..now I need to figure out what else is going on...for the conditionals..it was how I was shown to do it for a css menu so that it works in all browsers by an web instructor I had.

    edit-

    I fixed my problems on the index page..I closed off a missing </li> tag and I forgot to close a <p> tag!

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2010
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    2 or 3 of my pages are having problems still so maybe we can hash those out.

    my donate page is failing where I have a link to paypal:
    http://validator.w3.org/check?uri=ht...idator%2F1.767

    http://www.pazrt.com/donate-to-the-p...-response-team

    failing on my share page too:
    http://validator.w3.org/check?uri=ht...idator%2F1.767

    http://www.pazrt.com/share-the-penns...-response-team

    and 1 more spot..the contact page:
    http://validator.w3.org/check?uri=ht...idator%2F1.767

    http://www.pazrt.com/contact-the-pen...-response-team

    I really appreciate any help.

    -Andrew

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    With the donate page the first error is due to your not closing a paragraph before starting a list. Instead you have two line breaks.

    The rest of the errors on that page are because you have & where you should have &amp;
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Enthusiast
    Join Date
    Mar 2010
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    With the donate page the first error is due to your not closing a paragraph before starting a list. Instead you have two line breaks.

    The rest of the errors on that page are because you have & where you should have &amp;
    awesome..I managed to clean that page up and almost all my errors on my share page, but I'm having these 2 picky errors from within my textarea boxes:
    http://validator.w3.org/check?uri=ht...idator%2F1.767

    got my contact page to validate..now I ran into issues where the form processor isn't processing it..to get the form to validate I had to remove form name and replace it with form id..what changes would I have to make in the php processor to get it to reflect the changes?

    edit- fixed the contact page completely..still got to fix up that share page though.

  7. #7
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    You don't place 'px' units in the xhtml markup, wrong: ( height="168px" ). The 'px' is for CSS and if you were using xhtml it would be ( height="168" ) also the TEXTAREA cannot contain an image or hyperlink.

  8. #8
    SitePoint Enthusiast
    Join Date
    Mar 2010
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by xhtmlcoder View Post
    You don't place 'px' units in the xhtml markup, wrong: ( height="168px" ). The 'px' is for CSS and if you were using xhtml it would be ( height="168" ) also the TEXTAREA cannot contain an image or hyperlink.
    you learn something new every day...ok with that being said, how would I display code for visitors to grab and paste into their sites to display my site banners while it passes xhtml strict validation. I guess I could use a div and just set the width/height and an overflow, but how would I get it to display the a href and img code without displaying the image?

  9. #9
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    One popular way is to use pre and or code tags. We had a link-exchange page which needed to show the HTML for people to copy-pasta, and this sounds like what you want to do as well:

    Code:
    <p class="code"><code>&lt;a href="http://example.com" title="Example Co"&gt;Example Co&lt;/a&gt;</code></p>
    Where example.com was our url and the title was for mouseover tooltips (rather redundant but the manager wanted them, and notice the < and > symbols were typed out manually using named character entities (if you really are writing XHTML these are still good, because remember HTML has like 200 or so of these things but real XHTML only has 5, 4 of which it shares with HTML). So the &lt; represents "<" etc. On the web page itself, people will see the < > brackets normally.

    The class of "code" was for styling. You don't have to have a class with that name and you can of course just have any styling direct in the CSS:

    code {
    styles;
    }

    since "code" is a valid HTML element. I'd have to look it up but I believe code tags are inline elements like anchors.
    *edit yes they are.
    Last edited by Stomme poes; Apr 1, 2010 at 01:25. Reason: oops

  10. #10
    SitePoint Enthusiast
    Join Date
    Mar 2010
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    One popular way is to use pre and or code tags. We had a link-exchange page which needed to show the HTML for people to copy-pasta, and this sounds like what you want to do as well:

    Code:
    <p class="code"><code>&lt;a href="http://example.com" title="Example Co"&gt;Example Co&lt;/a&gt;</code></p>
    Where example.com was our url and the title was for mouseover tooltips (rather redundant but the manager wanted them, and notice the < and > symbols were typed out manually using named character entities (if you really are writing XHTML these are still good, because remember HTML has like 200 or so of these things but real XHTML only has 5, 4 of which it shares with HTML). So the &lt; represents "<" etc. On the web page itself, people will see the < > brackets normally.

    The class of "code" was for styling. You don't have to have a class with that name and you can of course just have any styling direct in the CSS:

    code {
    styles;
    }

    since "code" is a valid HTML element. I'd have to look it up but I believe code tags are inline elements like anchors.
    *edit yes they are.
    thanks for that...for some reason, I cannot seem to get a nice box to wrap the code...

    see here:
    http://www.pazrt.com/share-the-penns...-response-team

    here's my css
    Code:
    code
    {
    width: 29.38em;
    height: 6.25em;
    padding: 0.25em;
    border: solid thin #000;
    background-color: #FFF;
    color: #000;
    }
    here's the xhtml I wrote to display the code:
    Code:
    <p class="code"><code>&lt;a href="http://www.pazrt.com"&gt;&lt;img src="http://www.pazrt.com/images/banners/banner1.jpg" width="470" height="100" alt="pazrt.com" title="pazrt.com" style="border: 0" /&gt;&lt;/a&gt;</code></p>

  11. #11
    SitePoint Enthusiast
    Join Date
    Mar 2010
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nevermind... css mistake. I forgot to put the period before code.

  12. #12
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,882
    Mentioned
    74 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by andrewjs18 View Post
    nevermind... css mistake. I forgot to put the period before code.
    https://addons.mozilla.org/en-US/firefox/addon/249

    If you are working locally give the above FireFox Addon a try.

    All errors and/or warnings will be available to view as soon as you display your webpage in a browser. Hints on fixing the errors and/or warnings are shown.

    The Addon also includes a neat, configurable Tidy Utility.




    .
    Last edited by John_Betong; Apr 2, 2010 at 00:21. Reason: forgot the hint functions
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014

  13. #13
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    Wait, you have this:
    Code:
    code
    {
    width: 29.38em;
    height: 6.25em;
    padding: 0.25em;
    border: solid thin #000;
    background-color: #FFF;
    color: #000;
    }
    Because code is an inline tag (like spans and anchors) then unless you make it a block, it cannot have dimensions like that. They will be ignored.

    This is why in my example I have a <p> wrapping it. P's are blocks and can haz dimensions. On the actual page I have that code in, it's actually part of a definition list, so it's in a <dd>.

  14. #14
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,882
    Mentioned
    74 Post(s)
    Tagged
    6 Thread(s)
    Beware code is a reserved word and may introduce problems!!!!!




    .
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014

  15. #15
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    HTML doesn't have reserved words, just tags. Code is a HTML valid tag.

    <p><code><a href="sitepoint.com/forums">HOME</a></code></p>

    It's true if you're talking about Javascript, which does have reserved words which you don't want to use as variable names.


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
  •