WordPress.org

Ready to get started?Download WordPress

Forums

how to validate XHTML (13 posts)

  1. stchatterbox
    Member
    Posted 9 years ago #

    i donnu why, but just can't validate my XHTML
    look at it here, why? and how??

    http://validator.w3.org/check?uri=http%3A%2F%2Fwww.sv.formulx.com%2Fblog%2F

  2. stchatterbox
    Member
    Posted 9 years ago #

    anyone could reply me on this question, please????????????????thanks

  3. Monika
    Member
    Posted 9 years ago #

    use:
    revalidate with options

    use " source"

    then you'll better find out in which template..header..footer. ..sidebar ...
    your html is false.

  4. jbbrwcky
    Member
    Posted 9 years ago #

    And don't use the <font> tag, it's deprecated.

    If you are going to be using XHTML you should be putting all your font styling inside the stylesheet, not directly into your XHTML code. The XHTML is for structure, the CSS is for presentation.

    Jbbrwcky

  5. Jinsan
    Member
    Posted 9 years ago #

    read this thread:

    http://wordpress.org/support/topic/35418

    I don't see what the specific problem is, look at the source of where the problem is and fix it accoridng to the rules, start from 1 and go through it logically. So it tells you that the font tag is open but not closed, what would you do there? You close the tag. If it says li is mising, add it, if it says ul is open but not closed, do so and so on.

    Additionally to what jbbrwcky said, using styles within the markup, although allowed is not the best way to do things. Use divs instead.

  6. stchatterbox
    Member
    Posted 9 years ago #

    sounds a bit too abstract. please excuse me for my ignorance in computer knowledge.

  7. Jinsan
    Member
    Posted 9 years ago #

    what bit do you find "abstract"? perhaps we can clarify for you

  8. stchatterbox
    Member
    Posted 9 years ago #

    hmmm.....well, maybe you'll take a look at my site http://sv.formulx.com/blog and click to the valid XHTML link yourself, you'll later notice it's not valid, just wanna know how to valid it...

    by the way, what's the actualy usage for this XHTML? thanks a lot.

  9. aetherFox
    Member
    Posted 9 years ago #

    Well, I quickly looked at the errors.

    Errors 1, 2 and 3) are basically because you placed the end tag for the font tag in the wrong place. Put it directly after the text that you want styled -- currently you've got it after another block of text in some other paragraph tag.

    Error 4) You need a to tell the browser that you are starting a list, and need to use a ul tag in order to use li tags after it.

    Error 5) h2 is a block level element, I don't think you can place it in a list. Instead, place it out of the list. If need be, style the one li element to make the text fit your needs.

    The Rest) Similar problems. You should do some research on Google into semantically and standards-valid markup. There are many design-oriented blogs where articles on standards and correct markup are posted:

    http://www.stopdesign.com
    http://www.mezzoblue.com
    http://www.456bereastreet.com/
    http://www.simplebits.com
    etc.

    Read the comments that the validator gives for the errors. At first, it may seem cryptic, but after a while, those comments are useful. And remember - one little mistake might spawn 4 or 5 errors -- on my blog when I started validating my code, I had over 100 errors, but reducing them to nothing took little over 20 minutes.

    Hope I helped.

  10. stchatterbox
    Member
    Posted 9 years ago #

    well, thanks for your details explanation

    actually, i didn't do anything to the code, i didn't modify......but the errors just came default.

    well, maybe 20 minutes for you but definitely not me coz i'm really a dummy, fear that might get them all mess up! well, just let me know the usage of these XHTML or maybe i'll find someone to fix for me. if it's useless, i'll just delete the link.

  11. moshu
    Member
    Posted 9 years ago #

    let me know the usage of these XHTML...

    Wrong question :)
    XHTML is one of the possible doctypes. The doctype is defined in the very first line of your file(s). More doctypes are shown here.
    WP developers chose XHTML. Namely "XHTML 1.0 Transitional".
    Depending on your doctype the rules for the code and tags allowed may be different a bit. The validator just shows whether the code used in the file(s) is OK by the standards of that specific doctype.
    If you don't care about the validity of your code (and many people don't!) just delete that link saying it's Valid XHTML.

  12. Lorelle
    Member
    Posted 9 years ago #

    Now, this is going to sound nasty, but it isn't.

    In HTML/XHTML, when you start something, you have to finish it.

    In other words, when you open a door, you have to close it. And you have to close it right or your finger will be caught in the door.

    Enough with the analogies, using your few site errors, let's all learn how this works.

    This is the condensed first problem you have on your error report. It is a problem of wrong use of the font tag (as mentioned) and incorrect nested tags (put in the wrong place):

    <p><font color="#006666">
    <img width="329" vspace="0" hspace="5" height="220" border="0" align="left" src=".../images/full_face.jpg" alt="Front View of the theatre" title="Front View of the theatre" />
    </font>
    <font color="#006666">
    <strong>Before the construction....s a closer look at the facade.</strong></p>
    <p></font>

    First issue, the font. All font information needs to go in your style.css style sheet file. In this instance, you want to control the look of the <p> paragraph tag in your entry class. In your style sheet, look for something like this:

    .entry p {....

    If you do not find that, look for:

    body {...
    or
    .post {
    or
    #content {

    They may or may not feature a p after them like the first example I gave you. You will find font information in there. Make your changes to your font look there to change the look of the font in the post content area. Different Themes use different methods, so you have to play a little Sherlock Holmes. This article on Finding Your CSS Styles will help you play detective and find your styles.

    Make sure you go into your posts and competely eliminate all font references there.

    That will clean up that part of the problem.

    The problem with wrongly nested tags is when you open something and close it, but you close it wrong. For example, you can't do this:

    <strong><em>Some text</strong></em>

    You must close the first door before you can close the second.

    <strong><em>Some text</em></strong>

    In your case, you closed a font around an image, opened it up again, closed the paragraph, and then closed the font. The validator sees the end of the paragraph tag and thinks, "This dude forgot to close the font tag." It is closed, but after the next paragraph tag opens. Door closed in the wrong place.

    Again, in the next error, same thing.

    <div id="sidebar">
    <ul><li>
    <li>
    <form method="get"

    In your sidebar.php, a list is opened with UL. A List Item is started with LI, but then there is a second LI opened, and the first one is still open. Two doors open. Remove one.

    Nested lists are really tough to figure out, and there are many times when I wish they weren't used, but they have a purpose and they are used. To learn more about how to use nested lists in WordPress, see Styling Lists with CSS.

    The rest of the errors are the same, dealing with doors that opened but didn't close or were closed wrong. Such as:

    <p><ul><li><font color="#06c">Hello...

    A list doesn't need a paragraph tag, just the list opening UL, so remove the opening paragraph tag and make sure any closing paragraph tags are gone at the end of the list.

    Question: Are you writing your posts in a web editor like Dreamweaver or Front Page or something else? Or copying your "posts" from static HTML pages and pasting them into your Write Post editing screen?

    The errors with the font codes come from those sources, unless you specifically entered them yourself. Old versions of these programs overcode things and use old markup, like fonts, and they do not meet current web standards. Be very careful with this, and if you do it, make sure you learn how XHTML and CSS works. Don't want to learn, then just WRITE your posts in a text editor with spell check and paste, or write in your Write Post panel and WordPress will fix the XHTML up for you.

    I hope this helps. Most of the validation reports I see feature 50 to 200 errors sometimes, and these are just a few minor problems. Housekeeping, really. So don't stress too hard and just fix them.

  13. stchatterbox
    Member
    Posted 9 years ago #

    actually i didn't made those tags myself

    i use the WYSIWYG plugin from mudbomb.com and perhaps it did that by itself

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags