Q1. How do you write comments in HTML?
HTML comments are written as <!-- This is a comment -->. Comments are not displayed in the browser.
Q2. Why are comments useful in HTML?
Comments help document code, temporarily disable sections during debugging, and provide explanations for other developers.
Q3. Can comments be nested in HTML?
No, HTML comments cannot be nested. The first <!-- and --> pair closes the comment, causing syntax errors if nested.
Q4. Are HTML comments visible to users?
HTML comments are visible in the page source code but not rendered in the browser. Users can see them by viewing source.
Q5. Can you put HTML code inside comments?
Yes, any HTML code inside comments will be ignored by the browser, useful for temporarily disabling sections.
