Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts

    there is no attribute "align".

    I'm validating a template I have designed for a charity. I'm now down to my last HTML error and it is from my footer below:

    Code:
    <div class="footer">
    		 <div style="background-color: #FFF;" align="right">
    			<img style="margin: 20px 0px 30px 10px;" src="images/lottery.jpg" alt="The National Lottery funded" />
    			<img style="margin: 20px 40px 30px 40px;" src="images/cred.jpg" alt="Cred funded" />
    			<img style="margin: 20px 0px 5px 0px;" src="images/esf.jpg" alt="The European Social Fund" />
    			<img style="margin: 0px 0px 5px 20px;" src="images/lsc.jpg" alt="Learning Skills Council funded" />
    		 </div>
    		</div>
    If you look at this code you will notice align="right" in one of the divs. Here is the validation error message

    Error Line 64 column 46: there is no attribute "align".

    <div style="background-color: #FFF;" align="right">

    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.
    So somehow I must remove the align attribute. However I still want the div to be centered. How can I achieve this?

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    <div class="footer">
    		 <div style="background-color: #FFF;text-align:right;">
    			<img style="margin: 20px 0px 30px 10px;" src="images/lottery.jpg" alt="The National Lottery funded" />
    			<img style="margin: 20px 40px 30px 40px;" src="images/cred.jpg" alt="Cred funded" />
    			<img style="margin: 20px 0px 5px 0px;" src="images/esf.jpg" alt="The European Social Fund" />
    			<img style="margin: 0px 0px 5px 20px;" src="images/lsc.jpg" alt="Learning Skills Council funded" />
    		 </div>
    		</div>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    Ah yes thats the one thx

  • #4
    New Coder
    Join Date
    Dec 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question XHTML Validation Error (Last One Am Struggling With)

    Following on from the above as I was searching Google for an answer to my current issue which is very much like the above posters issue.

    Although mine maybe harder to correct because it is actually within the Google Search script I have placed on a small site I am re designing for my dads business, the previous owner was robbed for what they got. Old Site

    This is my problematic html section of the redesign'

    Code:
    <!-- Google CSE Search Box Begins -->
          <form id="searchbox_006611237071928125657:a3bxdv329lm" action="http://www.bamptonvillagestore.co.uk/testing7/search.htm">
            <div align="center"> 
              <input type="hidden" name="cx" value="006611237071928125657:a3bxdv329lm" />
              <input type="hidden" name="cof" value="FORID:11" />
              <input name="q" type="text" size="20" />
              <input type="submit" name="sa" value="Search" />
              <img src="http://www.google.com/coop/images/google_custom_search_smnar.gif" alt="Google Custom Search" /> 
            </div>
          </form>
          <!-- Google CSE Search Box Ends -->
    While validating and myself getting the errors down to one, I just can't make head nor tail of it and would be over the moon if somebody knows the definitive laymans term answer.

    Error Line 45 column 19: there is no attribute "align".

    <div align="center">

    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.


    Thanks for reading this people and I look forward to hearing from you.

  • #5
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    Use the same solution which Aerospace provided.

    Code:
    <div style="text-align:center">
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #6
    New Coder
    Join Date
    Dec 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Thank you

    Hi Bwiz,

    Thank you for the quick reply it is much appreciated, as is any guidance we receive from fellow people like yourself.

    I have just placed the W3C logo in the site and it had a border but no border attribute in the code, so I added one in and now it returns that error

    Code:
    <li><p>
        <a href="http://validator.w3.org/check?uri=referer"><img
            src="http://www.w3.org/Icons/valid-xhtml10"
            alt="Valid XHTML 1.0 Strict" height="31" width="88" border="0"/></a>
      </p></li>
    # Error Line 77 column 67: there is no attribute "border".

    ...d XHTML 1.0 Strict" height="31" width="88" border="0"/></a>

    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.


    Fancy me coming up with an error while it is the logo to show compliance that gives me the error but the addition of my learning curve with xhtml and soon to be getting rid of many errors in my css as the next on the list.

    I have actually fixed this now and it now looks like the following;

    Code:
    <a href="http://validator.w3.org/check?uri=referer">
    	<img style="border:0;width:88px;height:31px" 
    	src="http://www.w3.org/Icons/valid-xhtml10"
            alt="Valid XHTML 1.0 Strict" /></a>
    Last edited by uraccess4ink; 07-11-2007 at 07:24 AM.

  • #7
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    Again, you can use CSS for this. Just withing the <img> tag, place this:

    Code:
    style="border:0;"
    Alternativley, if you're going to have several image links and don't want borders on any of them, in each <img> tag, place this code:

    Code:
    class=linkNoBorder
    And place this in your stylesheet:

    Code:
    .linkNoBorder
    {
     border: 0;
    }
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #8
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    Quote Originally Posted by BWiz View Post
    Alternativley, if you're going to have several image links and don't want borders on any of them, in each <img> tag, place this code:

    Code:
    class=linkNoBorder
    And place this in your stylesheet:

    Code:
    .linkNoBorder
    {
     border: 0;
    }
    Another option:

    1. Leave out the class attribute from the img tags
    2. Place this in your css file
    Code:
    * img { border: 0; }

  • #9
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    You can even leave off the leading * without changing anything.

    Code:
    img {border:0}
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #10
    New Coder
    Join Date
    Dec 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    Hi Peeps,

    Thank you for the references above and I will refer to these should I do them the ways you mention in the future, which I would imagine will be very soon

    On another note and I have put the error in to search and it only returned one page and that was of no help at all but I am getting the following on a page that I have to have tables in to hold information and keep them all clean and aligned information wise but also need to show the border with these tables.

    Go to the site I am trying to do my best with for my dads business: Testing Site to see the tables in situ the above mentions.

    Their craply designed site they had to take over when they took the business over recently: Old Site

    If you select the HTML Validation button below the left hand side, you will then get returned the error and save page space in here. Plus I could maybe invite a few of your for whilst under construction constructive criticism, however please remember I in the past only dabbled with basic html and never css, so this is my first full from scratch site and validating it all etc.

    Thank guys your advice and feedback is of a great benefit and I often pass on the things I learn for my needs but to my friends and associates too.

  • #11
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    you can probably correct both of these errors by replacing
    Code:
     <td width="53%" height="22">Computer with Internet Access</td>
    with
    Code:
     <td style="width:58%;height:22px" >Computer with Internet Access</td>
    You can not say you know how to do something, until you can teach it to someone else.

  • #12
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    Your sites ok aswell I like it
    You can not say you know how to do something, until you can teach it to someone else.

  • #13
    New Coder
    Join Date
    Dec 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by timgolding View Post
    Your sites ok aswell I like it
    I was struggling until I popped my head back in here with the errors coming up on the height after you had taught me how to sort the width tag, thank you for making me today. As soon as I find out a solution it does make sense but as I'm learning all this, it sometimes takes some coaxing from other people's experience to help me along.

    I never normally have to ask again once I have learnt something knew, I just go through sites I have done to find the fix for a new one I am doing and so on.

    Thank you for the kind words about the site, I am awaiting all the new pictures they have took for the site and I have downloaded if I can find it quite a nifty looking horizontal image viewer script, has a kind of vista clean and glassy graphical look to it and there is a left and right arrow button at either end of this facility if that makes sense, that will be my next headache but will mosey on the best I can, it's all good fun lol.

    Have just added a nice explanative access options page too which I am pleased about and will eventually get all the things it says on there actually working, like the damn access keys won't work in my Firefox anyway.

    Thanks once again for your time and everyone else above, I have learnt what I know have been the worst errors and that I will no doubt come up against in other sites I do *bows*

  • #14
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    Glad you are happy this solution

    Code:
    <td style="width:58%;height:22px" >Computer with Internet Access</td>
    However its not ideal it would be better to link this information in a seperate style sheet and link through a class

    css code. save file as style.css and put in doc root
    Code:
       td.services_table
       {
        width:58%;
        height:22px:
       }
    and the basic html:

    Code:
        <html>
        <head>
       <link href="style.css" rel="stylesheet" type="text/css" />
       </head>
       <body>
            <!-- etc etc all your page etc etc -->
    
      
        <td class="services_table" >Computer with Internet Access</td>
    
       </body>
       </html>
    You can not say you know how to do something, until you can teach it to someone else.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •