Jump to content


Photo

there is no attribute "height", "background", "hsrc"...


  • Please log in to reply
9 replies to this topic

#1 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 16 June 2006 - 09:27 PM

I rewrote one of my HTML pages in XHTML and I checked it with W3C’s validation service and I get 5 errors, 4 of which are the same. The 4 say, there is no attribute "background", there is no attribute "height", there is no attribute "hsrc", there is no attribute "onClick", there is no attribute "align". I do not understand what that means?

I know this is a HTML forum help but hopefully someone here knows XHTML!

Thanks. If you need codes ask.
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 16 June 2006 - 10:44 PM

Pretty simple stuff. It means that the element(s) for which you have used the attribute 'height', height is NOT supported by the (x)HTML standard you're using. For example - height is NOT a supported attribute for the table element (despite many editors allowing it!). onClick might well be substituted by onclick (all lower case), and I've never seen hsrc. Etc., etc.

Basically, your code contains non-compliant html.

Couple of hints - html and xhtml are virtually identical. In xhtml always use lower case for attributes, always enclose attribute values with quotes.
Legend has it that reading the manual never killed anyone.
My site

#3 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 16 June 2006 - 10:49 PM

Line 309 column 21: there is no attribute "align".
<span align="center">
They recomended useing span to align center the image yet they say its not promited?

hsrc is part of a javascript and it is doing rollovers

what should I do about the hight attribute? I don't think I can delete it. Should I just leave it there?
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 16 June 2006 - 11:13 PM

Remote diagnosis when blindfolded is very difficult :)

Now if we got a look at the code, we could help. Part of the problem might be the DOCTYPE, but the root of the problem's in the code. 'Align' is long deprecated. And yes, xhtml compliant rollovers are possible.
Legend has it that reading the manual never killed anyone.
My site

#5 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 16 June 2006 - 11:29 PM

Yeah, not a problem, here's the code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <!--
        <script type="text/javascript">
        function init()
        {
        if (!document.getElementById) return
        var imgOriginSrc;
        var imgTemp = new Array();
        var imgarr = document.getElementsByTagName('img');
        for (var i = 0; i < imgarr.length; i++)
        {
        if (imgarr[i].getAttribute('hsrc'))
        {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].onmouseover = function()
        {
        imgOriginSrc = this.getAttribute('src');
        this.setAttribute('src',this.getAttribute('hsrc'))
        }
        imgarr[i].onmouseout = function()
        {
        this.setAttribute('src',imgOriginSrc)
        }
        }
        }
        }
        onload=init;
        </script>
        -->

        <link href="css.css" rel="stylesheet" type="text/css" />
        <title>About Me</title>
    </head>
    <body>

        <table border="0" cellpadding="0" cellspacing="0" align="center" width="100%">

            <tr>
                <td>
                    <table border="0" cellpadding="0" cellspacing="0" align="left" width="932">
                        <tr>
                            <td align="left">
                                <img src="nav_top_bann.png" width="932" height="69" alt="" />
                            </td>
                        </tr>
                    </table>

                </td>
            </tr>
            
            <tr>
                <td>
                                        <!-- Line 56 column 34: there is no attribute "background". Line 56 column 113: there is no attribute "height" -->
                    <table border="0" background="nav_time.png" cellpadding="0" cellspacing="0" align="left" width="700" height="23">
                        <tr>
                            <td align="left">
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <span class="secondhand">
                                    Thursday, June 15th, 2006
                                </span>

                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>

        <table border="0" cellpadding="0" cellspacing="0" align="left" width="100%" height="100%">
            <tr>

                <td>
                    <table border="0" cellpadding="0" cellspacing="0" align="left" width="192" height="100%">
                        <tr>
                            <td>
                                <img src="spacer1.3.png" alt="" />
                                <a href="index.php" target="_top">
                                        <!-- Line 80 column 37: there is no attribute "hsrc". -->
                                    <img src="home1.0.png" hsrc="home1.2.png" border="0" alt="" />
                                </a>
                            </td>

                        </tr>
                        
                        <tr>
                            <td>
                                <img src="spacer1.0.png" alt="" />
                            </td>
                        </tr>

                        <tr>
                            <td>

                                <img src="spacer1.2.png" alt="" />
                                <a href="about.php" target="_top">
                                    <img src="about1.0.png" hsrc="about1.2.png" border="0" alt="" />
                                </a>
                            </td>
                        </tr>

                        <tr>
                            <td>

                                <img src="spacer1.0.png" alt="" />
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.2.png" alt="" />
                                <a href="flash.php" target="_top">
                                    <img src="flash1.0.png" hsrc="flash1.2.png" border="0" alt="" />

                                </a>
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.0.png" alt="" />
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.2.png" alt="" />
                                <a href="joke.php" target="_top">
                                    <img src="joke1.0.png" hsrc="joke1.2.png" border="0" alt="" />
                                </a>
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.0.png" alt="" />
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.2.png" alt="" />

                                <a href="ge.php" target="_top">
                                    <img src="ge1.0.png" hsrc="ge1.2.png" border="0" alt="" />
                                </a>
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.0.png" alt="" />

                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.2.png" alt="" />
                                <a href="guide.php" target="_top">
                                    <img src="guide1.0.png" hsrc="guide1.2.png" border="0" alt="" />
                                </a>

                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.0.png" alt="" />
                            </td>
                        </tr>

                        <tr>

                            <td>
                                <img src="spacer1.2.png" alt="" />
                                <a href="down.php" target="_top">
                                    <img src="down1.0.png" hsrc="down1.2.png" border="0" alt="" />
                                </a>
                            </td>
                        </tr>

                        <tr>

                            <td>
                                <img src="spacer1.0.png" alt="" />
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.2.png" alt="" />
                                <a href="link.php" target="_top">

                                    <img src="link1.0.png" hsrc="link1.2.png" border="0" alt="" />
                                </a>
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.0.png" alt="" />
                            </td>

                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.2.png" alt="" />
                                <a href="stories.php" target="_top">
                                    <img src="stories1.0.png" hsrc="stories1.2.png" border="0" alt="" />
                                </a>
                            </td>

                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.0.png" alt="" />
                            </td>
                        </tr>

                        <tr>
                            <td>

                                <img src="spacer1.2.png" alt="" />
                                <a href="store.php" target="_top">
                                    <img src="store1.0.png" hsrc="store1.2.png" border="0" alt="" />
                                </a>
                            </td>
                        </tr>

                        <tr>
                            <td>

                                <img src="spacer1.0.png" alt="" />
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.2.png" alt="" />
                                <a href="forum.php" target="_top">
                                    <img src="forum1.0.png" hsrc="forum1.2.png" border="0" alt="" />

                                </a>
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.0.png" alt="" />
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.0.png" alt="" />
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.2.png" alt="" />

                                <a onclick="history.back()" target="_top">
                                    <img src="back1.0.png" hsrc="back1.2.png" border="0" alt="" />
                                </a>
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.0.png" alt="" />

                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="spacer1.0.png" alt="" />
                            </td>
                        </tr>
                        
                        <tr>

                            <td height="100%">
                                <img src="spacer1.1.png" height="100%" width="192" alt="" />
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <img src="nav_bot.png" alt="" />
                            </td>

                        </tr>
                    </table>

                </td>
                <td valign="top">
                    <table border="0" cellpadding="12" cellspacing="0" align="left" width="92%">
                        <tr>
                            <td valign="top" align="left">
                                <!-- Text Below -->



                                <!-- Text Above -->

                                <p>
                                    <!-- Line 312 column 21: there is no attribute "align". -->
                                    <span align="center">
                                        <img src="copyright.jpg" alt="" />
                                    </span>
                                </p>

                                <table border="0" background="link_of.png" cellpadding="0" cellspacing="0" align="center" width="458" height="26">
                                    <tr>
                                        <td align="center">

                                            <span class="secondhand">
                                                Link of the what ever I feel like putting here!
                                            </span>
                                        </td>
                                    </tr>
                                </table>

                                <table border="0" background="banner_back.png" cellpadding="0" cellspacing="0" align="center" width="493" height="162">
                                    <tr>
                                        <th>

                                            <a href="http://www.mozilla.com" target="_blank">
                                                <img src="fin.png" border="0" alt="" />
                                            </a>
                                        </th>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>

                </td>
            </tr>
        </table>
        <!--  Copyright 2005-2006 www.firemelt.net. All rights reserved. All content is copyrighted by firemelt.net.  -->
        <!--  Scripted and designed by Bob Leny, www.firemelt.net  -->
    </body>
</html>

-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#6 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 16 June 2006 - 11:41 PM

Lose the 'height' attribute in the table declaration. Get the background via styling:
table style="background: url(nav_time.png)" ...

If we're lucky, I'll find a compliant mouseOver on something I've done before.
Legend has it that reading the manual never killed anyone.
My site

#7 king arthur

king arthur
  • Members
  • PipPipPip
  • Advanced Member
  • 335 posts
  • LocationUK HQ

Posted 17 June 2006 - 09:08 AM

Try using 'center' tags instead of 'align="center"', it's also deprecated but is ok in XHTML Transitional and sometimes I just find it's the quick and dirty solution to centering things.
Sir Isaac Newton said "If I have seen farther, it is by standing on the shoulders of giants". But it is not recorded as to whether he said it before or after he was hit on the head by a falling apple.

#8 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 17 June 2006 - 04:27 PM

Yeah, <center></center>. Thats what I always use but the W3C vilation thingy says I can't use it.

But anyways. I'm going to let this go because I'm geting one error after another and infact the page in XHTML doesnt display right. I would have to rewrite the whole thing. So for now I guess I won't be useing XHTML.

Thanks for your help and sorry to waist our time.
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#9 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 17 June 2006 - 04:57 PM

For one dont use tables! try to create a CSS layout instead. Its much easier and better, that way you can change your site looks by changing your style sheet.

#10 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 17 June 2006 - 05:06 PM

Well, actually I can chage the entier layout, look, feel, design and graphics by changeing 3 files. So id say I've done pretty good.
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users