Course Content
Project file
0/1
Complete Web Designing Course for Beginners

MODULE 3 – CSS Fundamentals

πŸ”— Lesson 3.8 – Styling Links & Buttons

🎨 Creating Attractive Hyperlinks, Buttons, and Hover Effects


🎯 Learning Objectives

After completing this lesson, students will be able to:

βœ… Understand Hyperlinks and Buttons

βœ… Style Links Using CSS

βœ… Remove Underlines from Links

βœ… Change Link Colors

βœ… Use Hover Effects

βœ… Create Professional Buttons

βœ… Design Call-to-Action Buttons

βœ… Build Modern Website Navigation


πŸ“– Introduction

Imagine a website containing:

Β 
Home
About
Contact
Services
Β 

Simple text links look boring.


Now imagine:

Β 
[ Home ] [ About ] [ Services ] [ Contact ]
Β 

Beautiful colors.

Hover effects.

Professional design.


This is done using:

πŸ”— Link Styling

and

🎨 Button Styling


πŸ€” What are Links?

Links help users move from one page to another.

HTML uses:

<a>

tag for links.


Example

<a href="https://www.google.com">

Google

</a>

Default Link Appearance

Browser shows:

Β 
Blue Color

Underline
Β 

Example

<a href="#">

Home

</a>

Output

Blue underlined link.


🎯 Styling Links Using CSS

Example

a{

color:red;

}

Result

Link becomes red.


HTML

<a href="#">

Home

</a>

CSS

a{

color:blue;

}

Output

Blue link.


🌟 Removing Underline

Professional websites usually remove underlines.


Syntax

text-decoration:none;

Example

a{

text-decoration:none;

}

Result

Link appears without underline.


Example

a{

color:blue;

text-decoration:none;

}

🎨 Changing Link Font

Example

a{

font-size:20px;

font-weight:bold;

}

Result

Large bold link.


🎯 Link States

CSS provides special states for links.


1️⃣ Normal Link

a:link{

color:blue;

}

2️⃣ Visited Link

a:visited{

color:purple;

}

Meaning

After clicking:

Link becomes purple.


3️⃣ Hover Link

Most important.


Syntax

a:hover{

color:red;

}
Β 

Meaning

When mouse moves over link:

Color changes.


Example

a:hover{

color:red;

}

Result

Blue β†’ Red on hover.


4️⃣ Active Link

When user clicks.


a:active{

color:green;

}

Link State Order

Professional order:

Β 
a:link

a:visited

a:hover

a:active
Β 

🌟 Complete Link Example

HTML

<a href="#">

Home

</a>

CSS

a{

text-decoration:none;

font-size:20px;

font-weight:bold;

}

a:link{

color:blue;

}

a:hover{

color:red;

}

Output

Blue Link

Hover β†’ Red

No Underline


🎯 What is a Button?

Buttons allow users to:

βœ… Submit Forms

βœ… Navigate Pages

βœ… Perform Actions


HTML Button

Β 
<button>

Click Me

</button>
Β 

Default Button

Simple gray button.


🌟 Styling Buttons

Example

button{

background-color:blue;

color:white;

}

Result

Blue button with white text.


🎨 Button Background Color

Example

button{

background-color:green;

}

Button Text Color

Example

button{

color:white;

}

πŸ”  Button Font Size

Example

button{

font-size:18px;

}

πŸ“ Button Padding

Makes button bigger.


Example

button{

padding:10px;

}

Result

Larger button.


🌟 Rounded Buttons

Example

button{

border-radius:10px;

}

Result

Rounded corners.


Example

button{

border-radius:25px;

}

Result

Pill-shaped button.


🎯 Button Border

Example

button{

border:2px solid blue;

}

Result

Blue border around button.


🎯 Button Hover Effect

Most important effect.


Example

button:hover{

background-color:red;

}

Result

Mouse Hover:

Blue β†’ Red


Example

button:hover{

cursor:pointer;

}

Result

Hand cursor appears.


🌟 Professional Button Example

HTML

<button>

Register Now

</button>

CSS

button{

background-color:blue;

color:white;

font-size:18px;

padding:12px 25px;

border:none;

border-radius:10px;

}

button:hover{

background-color:darkblue;

cursor:pointer;

}

Output

Modern Professional Button


🎯 Call-to-Action Button

CTA means:

Call To Action


Examples:

Β 
Register Now

Join Course

Learn More

Contact Us

Buy Now
Β 

Example

button{

background-color:orange;

color:white;

font-size:20px;

padding:15px 30px;

border-radius:30px;

}

Result

Eye-catching button.


πŸ’» Complete Example Program

HTML

<!DOCTYPE html>

<html>

<head>

<link rel="stylesheet" href="style.css">

</head>

<body>

<h1>NextGen Dev Hub</h1>

<a href="#">Home</a>

<a href="#">Courses</a>

<a href="#">Contact</a>

<br><br>

<button>

Register Now

</button>

</body>

</html>

CSS

body{

font-family:Arial;

}

a{

text-decoration:none;

color:blue;

font-size:20px;

margin:15px;

}

a:hover{

color:red;

}

button{

background-color:green;

color:white;

font-size:18px;

padding:10px 20px;

border:none;

border-radius:10px;

}

button:hover{

background-color:darkgreen;

cursor:pointer;

}

🎯 Expected Output

βœ… Styled Navigation Links

βœ… Hover Effects

βœ… Professional Button

βœ… Modern Appearance


🏫 Real World Example

College Website

Β 
Home

About

Courses

Contact
Β 

Styled navigation links.


Online Course Website

Β 
Enroll Now
Β 

Professional CTA button.


E-Commerce Website

Β 
Buy Now

Add to Cart
Β 

Styled buttons.


⚠️ Common Beginner Mistakes


Mistake 1

Not Removing Underlines

Default links look outdated.


Use:

text-decoration:none;

Mistake 2

Using Very Bright Colors

Wrong:

background-color:yellow;

color:white;

Hard to read.


Use good contrast.


Mistake 3

No Hover Effect

Buttons look inactive.

Always add:

Β 
:hover
Β 

🌟 Best Practices

βœ… Remove unnecessary underlines.

βœ… Use hover effects.

βœ… Use rounded buttons.

βœ… Maintain consistent colors.

βœ… Use CTA buttons for important actions.


πŸ† Mini Project – Navigation Menu

Create:

Β 
Home

About

Services

Contact
Β 

Apply:

βœ… Blue Links

βœ… No Underlines

βœ… Hover Red


Create:

Β 
Register Now
Β 

Button with:

βœ… Green Background

βœ… White Text

βœ… Rounded Corners


πŸ“ Practical Activity

Create a webpage containing:

Navigation Menu

Home

About

Courses

Contact


Button

Enroll Now

Apply:

βœ… Hover Effects

βœ… Rounded Corners

βœ… Professional Colors

Run it in Chrome Browser.


πŸ“‹ Assignment

Assignment 3.8

  1. What is a hyperlink?
  2. Which HTML tag creates links?
  3. How do you remove underlines from links?
  4. What does :hover do?
  5. What is a CTA button?
  6. Create a navigation menu using styled links.
  7. Create a professional button with hover effects.

🧠 Quiz

Q1. Which tag creates hyperlinks?

A. <link>

B. <a>

C. <href>

D. <url>

βœ… Answer: B


Q2. Which property removes underlines?

A. remove-line

B. underline:none

C. text-decoration:none

D. text:none

βœ… Answer: C


Q3. Which pseudo-class applies styles when the mouse moves over an element?

A. active

B. hover

C. click

D. focus

βœ… Answer: B


Q4. Which property changes button background color?

A. color

B. button-color

C. background-color

D. fill

βœ… Answer: C


Q5. Which property creates rounded corners?

A. corner

B. radius

C. border-radius

D. round

βœ… Answer: C


πŸ“Œ Lesson Summary

βœ… Links are created using the <a> tag.

βœ… CSS can change link colors and remove underlines.

βœ… :hover creates interactive effects.

βœ… Buttons can be customized using colors, borders, padding, and border-radius.

βœ… Professional websites use hover effects and CTA buttons.

βœ… Styled links and buttons improve user experience.

Scroll to Top