SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot moretea's Avatar
    Join Date
    Jun 2004
    Location
    Texas, USA
    Posts
    118
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    HTML5: Types of stylesheets?

    I'm enjoying SitePoint's new HTML5/CSS3 book, but I have a question about the <style> tag. The authors say that it's no longer necessary to include the type attribute, since it's assumed that a stylesheet is going to be text/css. I saw long ago however, that there was a type = text/javascript. I could never find any documentation about this type of stylesheet construction; can anyone fill me in on this (possible) dinosaur of formatting? TIA!

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,615
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    JavaScript uses the script tag, CSS uses the style tag.

    That's could be why you didn't find it documented for the style tag.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    It was very badly worded regarding the 'type' attribute in that book. For STYLE and SCRIPT elements they REQUIRED type in HTML 4.01 on those two because the contents aren't treated as markup.

    HTML5 takes the lazy decision that you'll be using either JavaScript (text/javascript) or CSS (text/css) within document as default. With SCRIPT being for script statements and the STYLE being a content type of style language. Like Force Flow said the (text/javascript) is for scripting not style sheets.


Tags for this Thread

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
  •