Links in CSS

Links in CSS ka use karke tum HTML links ko stylish aur interactive bana sakte ho. Normally links simple blue aur underlined hote hain, but CSS se tum unhe fully customize kar sakte ho.


CSS Styling Links

HTML links ko tum multiple CSS properties se style kar sakte ho:

  • color
  • text-decoration
  • background-color
  • font-size
  • font-weight
  • font-family

Example:

Links in CSS

Styling Links Based on State

Links ke different states hote hain, aur tum unhe alag-alag style kar sakte ho.

4 Link States:

  1. :link → normal (unvisited link)
  2. :visited → already visited link
  3. :hover → jab mouse link ke upar aaye
  4. :active → jab link click ho raha ho

Important Order Rule:

  • :hover → hamesha :link aur :visited ke baad likhna hai
  • :active → hamesha :hover ke baad likhna hai

Example:

4 Link States

Links in CSS – Text Decoration

text-decoration property mainly underline remove ya add karne ke liye use hoti hai.

Example:

CSS Links – Text Decoration

Links in CSS – Background Color

Links ka background color bhi change kar sakte ho.

Example:

CSS Links – Background Color

CSS Link Buttons

CSS ka use karke tum normal links ko button jaisa design de sakte ho.


Example 1: Simple Button Style

Example 1: Simple Button Style

Example 2: Border Button Style

Example 2: Border Button Style

Important Points

  • Links ko different states ke according style kar sakte ho
  • Order follow karna important hai (link → visited → hover → active)
  • text-decoration se underline control hota hai
  • background-color se links highlight hote hain
  • CSS se links ko button me convert kar sakte ho

Links in CSS web design ka important part hai jo user interaction aur navigation ko improve karta hai. CSS properties aur link states ka proper use karke tum attractive aur user-friendly links bana sakte ho.

Proper styling se:

  • User experience better hota hai
  • Website interactive lagti hai
  • Navigation easy ho jata hai

Leave a Comment