SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict
    Join Date
    Jun 2009
    Posts
    317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Attribute "align" exists, but can not be used for this element.

    hi,

    I have this error in my validation, How do I get rid of it?

    Line 132, Column 11: Attribute "align" exists, but can not be used for this element.

    <h3 align="justify">&nbsp;</h3>



    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.

  2. #2
    Non-Member thewebhostingdir's Avatar
    Join Date
    Oct 2005
    Posts
    703
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try changing it to.

    <h3 style="text-align: justify;">&nbsp;</h3>

    The warning should be removed if you use above construct.

  3. #3
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by leehughes View Post
    this is usually fixed by using CSS to achieve the desired effect instead.
    Do as it says, use CSS for the align attribute, you should not be declaring any style within your HTML, its extremely outdated and no longer considered acceptable, and in regards to thewebhostingdir, surely it makes more sense to declare the style externally rather than structurally embedding CSS.

  4. #4
    SitePoint Addict
    Join Date
    Jun 2009
    Posts
    317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahh thanks..

  5. #5
    SitePoint Wizard Blake Tallos's Avatar
    Join Date
    Jun 2008
    Location
    Cuyahoga Falls, Ohio.
    Posts
    1,510
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code CSS:
    <h3></h3>
     
     
    h1,h2,h3,h4,h5,h6 {
        text-align:justify;
    }
     
    h3 {
        text-align:justify; //aligns text
     
    }
     
    h3 Attributes
     
    text-align:center;
    text-align:left;
    text-align:right;
    text-align:justify;
     
     
    align=" { left | center | right | justify } "
    Blake Tallos - Software Engineer for Sanctuary
    Software Studio, Inc. C# - Fanatic!
    http://www.sancsoft.com/


  6. #6
    SitePoint Wizard Blake Tallos's Avatar
    Join Date
    Jun 2008
    Location
    Cuyahoga Falls, Ohio.
    Posts
    1,510
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AlexDawson View Post
    Do as it says, use CSS for the align attribute, you should not be declaring any style within your HTML, its extremely outdated and no longer considered acceptable, and in regards to thewebhostingdir, surely it makes more sense to declare the style externally rather than structurally embedding CSS.
    Ohh come on Alex! Why would we care about that? LOL
    All were trying to do is get this text to justify so I can cram inline html into my table based layout (which by the way) is completely broken.
    Blake Tallos - Software Engineer for Sanctuary
    Software Studio, Inc. C# - Fanatic!
    http://www.sancsoft.com/


  7. #7
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by BlakeAnthony View Post
    Ohh come on Alex! Why would we care about that? LOL
    All were trying to do is get this text to justify so I can cram inline html into my table based layout (which by the way) is completely broken.
    We are? I didn't know your name was leehughes

  8. #8
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,881
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by leehughes View Post
    <h3 align="justify">&nbsp;</h3>
    Alex has told you how to do that ... but I'm going to ask ... why do you want to?

    Justified text rarely looks good on screen, and particularly on web pages. The spacing doesn't have a fine enough control to look even and well balanced. It can be OK on long, wide paragraphs, but on anything less than that, it will almost certainly look scrappy. And you want to use that on a heading?!

    Headings are often only one line long. Where that is the case, fully justified alignment gives the same effect as left alignment, which is the default.

    If you have a long heading and it splits onto two lines, it is likely to look stretched and messy where the first line is pulled across the full width (and the second line retains its natural fit), but the right margin isn't lining up with anything because there's only one line there.

    If you have a heading that you are expecting to be more than 3 lines long, I would question whether that is really a heading, or if it should be a paragraph!


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
  •