We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
  • Pages:
  • 1
  • 2
Comments?
Topic Started: Jan 11 2005, 04:21 PM (792 Views)
FearKiller
Member Avatar
www.drewscripts.com
[ *  *  *  *  * ]
Quote:
 
// does not work in CSS, only /*

And if you put <!-- --> in your CSS files, they WILL NOT VALIDATE. This is wrong and bad.

<!-- --> HTML
// JS
/* */ JS, CSS

Here is a page I created using internal CSS that is wraped in comment tags.
http://www.fearkiller.net/test/internal.html
Here is the validation results for that page.
http://validator.w3.org/check?uri=http%3A%...2Finternal.html

Quote:
 
Older browsers will not see the styles anyways as long as they are within your <head>. Or use @IMPORT or <link rel /> to be even safer.

Older browsers will display the internal CSS if it is not wraped in comment tags. Look at it this way, the "<style>" tag is unrecognized by an older browser, just as this fake tag I just created isn't recognized by todays current browsers "<unrecognizedtag>" With that said, I take you to this page http://www.fearkiller.net/test/nostyles.html If you view the source of this page you'll see that my "<unrecognizedtag>" is being used to surround the CSS. That tag is bypassed by the browser. It is not displayed nor rendered in anyway on the screen, but the CSS within those tags is displayed. If you think that the CSS is being displayed because of my special fake tags, you may try it without the "<unrecognizedtag>" and see that the CSS is still displayed on the screen. The correct way to use internal CSS is as follows
Code:
 
<style type="text/css">
<!--
/* ADD A COMMENT HERE IF YOU LIKE */
body {
color: #FFFFFF;
background-color: #000000;
}
-->
</style>
Offline Profile Quote Post Goto Top
 
Seth
Member Avatar
I has a pony
[ *  *  *  *  *  *  *  *  * ]
He wins :rofl: well played. I still think, however, that browsers old enough to not recognize <style> hide everything in the <head>, unlike new browsers.

In the end, though, who uses IE 3 and Netscape 4 anymore, anyways :P
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
DealsFor.me - The best sales, coupons, and discounts for you
« Previous Topic · Technology Chat · Next Topic »
Add Reply
  • Pages:
  • 1
  • 2