SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Confusing Validation Error

    Hi guys,

    Anyone come across this kind of validation error before ?

    The tag: "style" doesn't have an attribute: "rel" in currently active versions.
    Code:
    <style rel="stylesheet" type="text/css" media="screen">
    @import "css/main.css";
    </style>

    Thanks

    Tim

  2. #2
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's confusing about it? It says rel="" in invalid on <style>. So remove it.
    Simon Pieters

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    confusing because...

    Im confused as I have seen it declared in a css book brought from sitepoint. Though the doc type was xhtml-trans not strict?

    Why would this make a difference?

    thanks tim

  4. #4
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you sure? Wasn't that <link>?
    Simon Pieters

  5. #5
    SitePoint Enthusiast ComputerGuru247's Avatar
    Join Date
    Jul 2006
    Location
    Wisconsin
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    Incorrect
    <style rel="stylesheet" type="text/css" media="screen">
    @import "css/main.css";
    </style>
    
    correct
    <style rel="stylesheet" type="text/css" href="css/main.css" media="screen" />
    See if that gets rid of the error.
    Bryan

    Breakpoint Designs - Web Design, Logos, and more!

  6. #6
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ComputerGuru247 View Post
    Code:
    Incorrect
    <style rel="stylesheet" type="text/css" media="screen">
    @import "css/main.css";
    </style>
    
    correct
    <style rel="stylesheet" type="text/css" href="css/main.css" media="screen" />
    See if that gets rid of the error.
    That just adds up the validation errors: there's no href attribute on <style> either and you need an end tag in HTML.

    To be clear, it should either be:
    HTML Code:
    <style type="text/css" media="screen">
    @import "css/main.css";
    </style>
    or
    HTML Code:
    <link rel="stylesheet" type="text/css" href="css/main.css" media="screen">
    Simon Pieters

  7. #7
    SitePoint Enthusiast ComputerGuru247's Avatar
    Join Date
    Jul 2006
    Location
    Wisconsin
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I use transitional and it validates.
    Bryan

    Breakpoint Designs - Web Design, Logos, and more!

  8. #8
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't forget that the validators are not perfect either. Put the rel and href attributes where they belong, as Simon suggested, and you'll be fine.

  9. #9
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,122
    Mentioned
    29 Post(s)
    Tagged
    2 Thread(s)
    Don't forget that the validators are not perfect either
    Can you qualify that statement?

    It's just I thought the w3c was perfect by definition


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
  •