Help - Search - Members - Calendar
Full Version: HTML Validation
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
ofi
Hi
I am validation my site, and get some errors, i am trying to fix this, how can i fix this error

CODE
# Line 161, character 32:

...            <td class="genmed">
                                 ^

Error: element td not allowed here; assuming missing tr start-tag


CODE
       <div id="menubar">
          <table width="100%" cellspacing="0">
          </tr>
             <td class="genmed">
<td style="padding-top: 20px;">


Line 161 is
<td class="genmed">
Darin McGrew
You've got </tr> where you should have <tr>
ofi
"required attribute "alt" not specified"

CODE
<h2><img src="http://www.almennt.com/prufusida/test2/images/rubikcube.png" width="100" height="111" /></h2>



The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.
Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.


what it wrong with this ?
pandy
What it says. An alt attribute is mandatory for IMG. You don't have any. smile.gif
http://htmlhelp.com/reference/html40/special/img.html

Note that the alt text is supposed to replace the image, if it for whatever reason can't be loaded. So if you have a picture of a rose, "Rose" is a suitable alt text and "Roses are lovely, aren't they? And they smell so good!" is not. If the image is purely decorative, i.e. not important for content/context in any way, not linked and so on, you can use a blank alt, alt="".
http://htmlhelp.com/feature/art3.htm
Tom H.
QUOTE(pandy @ Jun 26 2008, 10:28 AM) *

So if you have a picture of a rose, "Rose" is a suitable alt text and "Roses are lovely, aren't they? And they smell so good!" is not.

I disagree with pandy's example of suitable and unsuitable alternate text, and I think her cited article supports my view. The single word, "Rose" does very little to convey what information the image is trying to convey; it's really no better than using "picture of a rose." Single words like this often just repeat words which are already given in adjacent headlines and text, so their repetition is pointless. In the example given, something like "roses can be grown alongside a fence" may be a suitable description, if the picture is illustrating that. Frequently I find blank alternate text is the best option.
pandy
Sure, if that's what the image shows. If it shows just a rose it may be little over the top. tongue.gif

Anyway, my point was to keep in mind that alt text should work as a replacement for the image. It's not for funny tooltips or other embellishments.
ofi
thx for this at least, did fix the image error
CODE
<h2><img src="http://www.almennt.com/prufusida/test2/images/rubikcube.png" width="100" height="111" alt="" /></h2>
ofi
Hi.............. again smile.gif

always learning, well, what is "container" and what does it do ?
I need to close
CODE
<div id="container">
ofi
sorry, double post
pandy
It's a CSS class (named by you or whoever wrote the page) and it does what's you (or someone else) assigned to it in the style sheet.
ofi
In validation it says <div need to be closed, i have try to put closed div tag "i think" everywhere on the page, and all i get, is more errors, is that normal.

here is code where the container starts
CODE
    <div id="container">

    <div id="top"></div>

<div id="wrapheader">
  <table width="100%" cellspacing="0">
          <tr>
             <td>
    <h2><img src="http://www.almennt.com/prufusida/test2/images/rubikcube.png" width="100" height="111" alt="" /></h2>
             </td>
          </tr>
          <tr>
             <td class="navmenu"><a href="http://www.almennt.com/prufusida/test2/index.php">Heim</a></td>
             <td class="navmenu"><a href="http://www.almennt.com/prufusida/test2/eg.php">Um mig</a></td>
             <td class="navmenu"><a href="http://www.almennt.com/prufusida/test2/phpBB3/">Spjall</a></td>
             <td class="navmenu"><a href="http://www.almennt.com/prufusida/test2/sam.php">Samband</a></td>
             <td class="navmenu"><a href="#">Myndir</a></td>
          </tr>
          </table>
       <div id="logodesc">
          <table width="100%" cellspacing="0">
          </table>
       </div>

       <div id="menubar">
          <table width="100%" cellspacing="0">
          <tr>
             <td class="genmed" style="padding-top: 20px;">
                <!-- IF not S_IS_BOT --><a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_LOGIN_LOGOUT}</a>&nbsp;<!-- ENDIF -->
                <!-- IF U_RESTORE_PERMISSIONS --> &nbsp;<a href="{U_RESTORE_PERMISSIONS}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_RESTORE_PERMISSIONS}</a><!-- ENDIF -->
                <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN --> &nbsp;<span style="color: red;">{L_BOARD_DISABLED}</span><!-- ENDIF -->
                <!-- IF not S_IS_BOT -->
                   <!-- IF S_USER_LOGGED_IN -->
                      <!-- IF S_DISPLAY_PM --> &nbsp;<a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><!-- ENDIF -->
                   <!-- ELSEIF S_REGISTER_ENABLED --> &nbsp;<a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" alt="*" /> {L_REGISTER}</a>
                   <!-- ENDIF -->
                <!-- ENDIF -->
            </td>
             <td class="genmed" style="padding-top: 20px;" align="{S_CONTENT_FLOW_END}">
                <a href="{U_FAQ}"><img src="{T_THEME_PATH}/images/icon_mini_faq.gif" width="12" height="13" alt="*" /> {L_FAQ}</a>
                <!-- IF S_DISPLAY_SEARCH -->&nbsp; &nbsp;<a href="{U_SEARCH}"><img src="{T_THEME_PATH}/images/icon_mini_search.gif" width="12" height="13" alt="*" /> {L_SEARCH}</a><!-- ENDIF -->
                <!-- IF not S_IS_BOT -->
                   <!-- IF S_DISPLAY_MEMBERLIST -->&nbsp; &nbsp;<a href="{U_MEMBERLIST}"><img src="{T_THEME_PATH}/images/icon_mini_members.gif" width="12" height="13" alt="*" /> {L_MEMBERLIST}</a><!-- ENDIF -->
                   <!-- IF S_USER_LOGGED_IN -->&nbsp; &nbsp;<a href="{U_PROFILE}"><img src="{T_THEME_PATH}/images/icon_mini_profile.gif" width="12" height="13" alt="*" /> {L_PROFILE}</a><!-- ENDIF -->
                <!-- ENDIF -->
             </td>
          </tr>
          </table>
       </div>

       <div id="datebar">
          <table width="100%" cellspacing="0">
          <tr>
             <td class="gensmall"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ENDIF --></td>
             <td class="gensmall" align="{S_CONTENT_FLOW_END}">{CURRENT_TIME}<br /></td>
          </tr>
          </table>
       </div>

    </div>

    <div id="wrapcentre">

       <!-- IF S_DISPLAY_SEARCH -->
       <p class="searchbar">
          <span style="float: {S_CONTENT_FLOW_BEGIN};"><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a> | <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></span>
          <!-- IF S_USER_LOGGED_IN -->
          <span style="float: {S_CONTENT_FLOW_END};"><a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></span>
          <!-- ENDIF -->
       </p>
       <!-- ENDIF -->

       <br style="clear: both;" />

       <!-- INCLUDE breadcrumbs.html -->

       <br /></div>
Christian J
Edit: didn't see the above post. Retreating... blink.gif
pandy
QUOTE(ofi @ Jun 28 2008, 07:40 PM) *

In validation it says <div need to be closed, i have try to put closed div tag "i think" everywhere on the page

Looks like that DIV is supposed to contain all other markup, so I guess the closing tag should be last, before </body>. If the code you posted is all there is between the body tags, that is.

QUOTE

and all i get, is more errors, is that normal.

If you put it in the wrong place, yes. Also, one error can mask others, but I don't hink that happens here.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.