| 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: |
- Pages:
- 1
- 2
| Comments? | |
|---|---|
| Tweet Topic Started: Jan 11 2005, 04:21 PM (793 Views) | |
| Hero_of_time | Jan 11 2005, 04:21 PM Post #1 |
|
I love Emily :wub:
![]() ![]() ![]() ![]() ![]() ![]()
|
Ok, we all know (or all should know), that to comment out something in an HTML document it's: <!--something--> And, when adding a comment, it does NOT show up on the page (and if you comment out code, the code doesn't work)... so my question is, how come on some pages I've viewed the source of, their CSS is wrapped in comment tags, but yet the CSS still works on the page? How come the CSS isn't "invisible" to the browser? and what's the point/advantage/disavantage of wrapping the CSS in comment tags? |
![]() |
|
| Maelroth | Jan 11 2005, 04:27 PM Post #2 |
|
Keeping an eye on you
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Different make up language? maybe the comment tag only works in html and java script as far as i know |
![]() |
|
| Gornakle | Jan 11 2005, 04:38 PM Post #3 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
The code ignores those comment tags. The reason why they're there is so older browsers that don't support CSS will not be able to view it (otherwise, the whole stylesheet will be displayed on screen). |
![]() |
|
| Hero_of_time | Jan 11 2005, 04:47 PM Post #4 |
|
I love Emily :wub:
![]() ![]() ![]() ![]() ![]() ![]()
|
Oh ok, thanks! |
![]() |
|
| korn_mosher_4life-ZNS | Jan 11 2005, 08:59 PM Post #5 |
|
the korn mosher 4life
![]() ![]() ![]() ![]() ![]() ![]()
|
dont forget // and /*...*/ easier then trying to remember <!--....--> .....for me anyways. |
![]() |
|
| Deleted User | Jan 12 2005, 03:06 AM Post #6 |
|
Deleted User
|
Those only work within script tags, don't they? :unsure: |
|
|
| Cool Dude 2k | Jan 12 2005, 04:48 AM Post #7 |
![]()
<?php echo "Linux"; ?>
![]() ![]() ![]() ![]()
|
/*...*/ also works in style tags and CSS Files.
|
![]() |
|
| Deleted User | Jan 12 2005, 06:16 AM Post #8 |
|
Deleted User
|
Well.. you learn something new every day! By the way, you spelled respect wrong in your sig, unless you meant repect list? :stefan: |
|
|
| Rory | Jan 12 2005, 08:47 AM Post #9 |
|
i;m a mess
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
<!-- and --> only work in HTML. // and /* */ work in css (javascript as well?) if you are using <!-- --> in your css, then it won't hide the code (i'm pretty sure). |
![]() |
|
| Ali-ZNS | Jan 12 2005, 05:28 PM Post #10 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Yes, you're indeed correct. With JavaScript single line comments are made with the // characters. So for example, for a single line comment on a section of JavaScript coding I could use:
And the /* */ characters are made for multi-line comments. For example:
As for hiding the codes in CSS using HTML comment tags (<!-- CODE HERE -->), then no, that doesn't hide the code. It's used for commenting and is still visable via page source unless some sort of script is implanted on the webpage that messes with viewing page source via a persons browser. Ali |
![]() |
|
| Renee S | Jan 13 2005, 10:14 PM Post #11 |
|
Renée S
![]() ![]() ![]()
|
Cool dident know that. B) |
![]() |
|
| Seth | Jan 13 2005, 10:17 PM Post #12 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
// 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 |
![]() |
|
| Seth | Jan 13 2005, 10:19 PM Post #13 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
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. |
![]() |
|
| Renee S | Jan 13 2005, 10:43 PM Post #14 |
|
Renée S
![]() ![]() ![]()
|
I thought that // did not work in CSS but i was not too sure. Thanks for telling me Seth.
|
![]() |
|
| Seth | Jan 13 2005, 11:00 PM Post #15 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
![]()
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · Technology Chat · Next Topic » |
- Pages:
- 1
- 2
| Track Topic · E-mail Topic |
8:51 PM Jul 10
|



![]](http://b1.ifrm.com/0/1/0/p601690/pipright.png)




8:51 PM Jul 10