CHAPTER 17
CSS Links
Learn how to style hyperlinks and create attractive interactive navigation links.
01. What is CSS Links?
Links allow users to move from one webpage to another.
CSS can change link color, decoration and hover behavior.
Pseudo-classes such as :hover can create interactive effects.
02. Syntax
a {
color: value;
text-decoration: value;
}
a:hover {
color: value;
}
03. Example
CSS / HTML Example
AIFA Coding Lab
<!DOCTYPE html>
<html>
<head>
<style>
a {
color: #2563eb;
text-decoration: none;
font-weight: bold;
}
a:hover {
color: #06b6d4;
text-decoration: underline;
}
</style>
</head>
<body>
<a href="#">
Visit AIFA Infotech
</a>
</body>
</html>
04. Important Points
✓
Use color to make links identifiable.
✓
The :hover pseudo-class creates hover effects.
✓
text-decoration can remove or add underlines.
✓
Links should remain accessible and easy to recognize.
05. Common Mistakes
⚠
Removing underlines without another clear visual indicator.
⚠
Using colors with poor contrast.
⚠
Making links look exactly like normal text.
06. Real World Use
Styled links are used in navigation bars, footers, buttons, blog posts, menus and landing pages.
Ready to Practice? 🚀
Open the AIFA CSS Editor and practice this chapter live.
Try It Yourself →
Practice Exercise
Create a Navigation Link
Create three links and add a different color when the user moves the mouse over them.