Web Analytics Made Easy -
StatCounter text/css and "text/css" - CodingForum

Announcement

Collapse
No announcement yet.

text/css and "text/css"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • text/css and "text/css"

    i would like to know if <style type=text/css> & <style type="text/css"> is same , or does the " makes any difference?


    thx lots

  • #2
    Code:
    <style text="text/css">
    is valid html & css while the other isnt
    GET FIREFOX
    Firefox vs ie7 game
    My firefox website

    Comment


    • #3
      The other is valid but only in HTML. If you are using XHTML then its not valid.
      ||||If you are getting paid to do a job, don't ask for help on it!||||

      Comment


      • #4
        Originally posted by _Aerospace_Eng_ View Post
        The other is valid but only in HTML. If you are using XHTML then its not valid.
        Code:
        <style text="text/css">
        ...is valid both in html and xhtml.

        Gary
        'cna ne1 plz giv cod'

        Comment


        • #5
          I was referring to the one without quotes which wouldn't be valid in XHTML.
          ||||If you are getting paid to do a job, don't ask for help on it!||||

          Comment


          • #6
            Best to include the quotes around the value of ALL attributes even in HTML as then the browser doesn't have to work out where the value ends and you avoid the possibility of having a browser interpret your value differently than you expected.

            Where something is optional in the HTML standard then good coding practice is to always include it unless there is a reason not to include it. eg. closing </p> tags are optional but your page will load slower if you don't include them, the title attribute is also optional but only needs to be included where you actually want to attach a tooltip (as when you don't need a tooltip there are benefits to not including the title attribute).
            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.

            Comment


            • #7
              thx for the help , i will include the quote.

              Comment

              Working...
              X