|
gorilla -> RE: Warning! -Take the wrong comment type out of your stylesheets NOW (11/19/2003 18:33:57)
|
quote:
ORIGINAL: c1sissy 1. In regards to what Shirley posted. Isn't this a different means of commenting? 2. The one that Shirley has referred to is the one that you would use for commenting OUT code? Say I'm trying something not sure if I like it, but don't want to get rid of it while I try something else, I would just comment it out, and if I decide that this is what I want I would just remove the comments? As well as the reason that is mentioned in the thread that Shirley posted. 3. The commenting out that is referred to in your posting is to keep other browsers that aren't css compatible from seeing the styles? Don't mean to be a stubborn student here, but lol, just want it all to make sense[;)] <edit> 4. http://www.w3.org/TR/2003/WD-CSS21-20030915/syndata.html#comments How does this apply to using or not using? and is this standard or not standard?</edit> 1. No, it is the correct way of commenting in a - an external css file. b - an stylesheet embedded in the document. 2. Yes, and that is indeed a very good use for it. But it is by no means limited to that. Comments are there to for example, help you remember which bit of the file refers to which selectors. EG: /* Start of left navigation styles */ stuff /*End of left navigation styles */ /* Start of right navigation styles */ stuff /*End of rigth navigation styles */ /* Start of main content styles */ stuff /*End of main content styles */ /* Start of hacks to cope with broken box model in ie5.5 styles */ stuff /* End of hacks to cope with broken box model in ie5.5 styles */ and so on. Comments are just that. any text between this: /* and this */ will simply be ignored by the UA. IOW you can put in anything you like upto and including the collected works of William Shakespeare and as long as they are between /* and */ they'll be ignored. 3. Yes, they are html comments. HOwever as I have clarified further below with a quote from the relevant document for anything above html3.2 it is sematically and syntactically incorrect to use it. Forthcoming gecko based UAs can (and will) "silently remove" anything between html comments. with a very unpleasant effect upon your page. - This is per spec btw. 4. Key paragraph is: quote:
CSS also allows the SGML comment delimiters ("<!--" and "-->") in certain places, but they do not delimit CSS comments. They are permitted so that style rules appearing in an HTML source document (in the STYLE element) may be hidden from pre-HTML 3.2 user agents. See the HTML 4.0 specification ([HTML40]) for more information Emphasis added by me. - So not part of html 4.0 bis. 5. Be as stubborn as you like it needs to make sense. [:D] 6. That page btw is one of the more important ones in the spec. jb
|
|
|
|