Comments in CSS

Comments in CSS ka use code ko explain karne ke liye hota hai, taaki baad me code samajhna easy ho jaye.

Comments ka ek aur use hai: Temporary kisi CSS code ko disable (band) karna.

Important baat: Browser comments ko ignore karta hai, yani wo output me show nahi hote.


CSS Comment Syntax

CSS me comment likhne ke liye:

  • Start: /*

  • End: */

Example

Comments in CSS

Comment Anywhere in Code

Aap CSS code ke kisi bhi part me comment likh sakte ho.

Example

Comment Anywhere in Code

Comment in Middle of Line

Comment code ke beech me bhi likh sakte ho.

Example

Comment in Middle of Line

Multi-line Comments

Agar bada explanation dena ho to multiple lines me comment likh sakte ho.

Example

Multi-line Comments

HTML and CSS Comments Together

HTML me comment ka syntax alag hota hai:

  • HTML comment: <!-- -->

Example

HTML and CSS Comments Together

Comments in CSS ka use karke aap code ko easily explain, manage aur temporarily control kar sakte ho bina output ko affect kiye.

Leave a Comment