...

View Full Version : text/css and "text/css"



Firestorm
09-24-2006, 07:59 PM
i would like to know if <style type=text/css> & <style type="text/css"> is same , or does the " makes any difference?


thx lots

googleit
09-24-2006, 08:10 PM
<style text="text/css">
is valid html & css while the other isnt

_Aerospace_Eng_
09-24-2006, 10:45 PM
The other is valid but only in HTML. If you are using XHTML then its not valid.

Graft-Creative
09-24-2006, 11:57 PM
The other is valid but only in HTML. If you are using XHTML then its not valid.



<style text="text/css">


...is valid both in html and xhtml.

Gary

_Aerospace_Eng_
09-25-2006, 12:01 AM
I was referring to the one without quotes which wouldn't be valid in XHTML.

felgall
09-25-2006, 12:14 AM
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).

Firestorm
09-25-2006, 02:49 PM
thx for the help , i will include the quote.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum