For example :
<style type="text/css">
<!--
#map{ width:500px;height:500px;float:left }
-->
</style>
What is the usage of <!-- -->
?
Like most languages, CSS allows the users to add comments in the stylesheet. Comments in CSS can be added by using the /* tag, which is then closed off by using */ . Note: Code that is commented out is not used to style the page. This technique can be used to add both single and multi-line comments.
The /* */ comment syntax is used for both single and multiline comments. There is no other way to specify comments in external style sheets.
HTML Comment Tag Notice that there is an exclamation point (!) in the start tag, but not in the end tag. Note: Comments are not displayed by the browser, but they can help document your HTML source code.
An HTML comment begins with <! –– and the comment closes with ––> . HTML comments are visible to anyone that views the page source code, but are not rendered when the HTML document is rendered by a browser.
It stops Netscape 2 era browsers, which don't recognize the <style>
element, from rendering the content as text (since they start to render the content, but it is a comment, so it isn't rendered).
This is described in the HTML specification.
Entirely worthless today, but people keep adding them without understanding them in a cargo cult mentality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With