- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Add different styles to hyperlinks using CSS
To set different styles to hyperlinks, such as font-size, background color, etc, you can try to run the following code:
Example
<!DOCTYPE html> <html> <head> <style> a.first:link {color:#ff0000;} a.first:visited {color:#0000ff;} a.first:hover {color:#ffcc00;} a.second:link {color:#ff0000;} a.second:visited {color:#0000ff;} a.second:hover {font-size:150%;} a.third:link {color:#ff0000;} a.third:visited {color:#0000ff;} a.third:hover {background:#66ff66;} </style> </head> <body> <p>Mouse over the below given links:</p> <p><b><a class = "first" href = "demo1.html" target = "_blank">Link changes color</a></b></p> <p><b><a class = "second" href = "demo2.html" target = "_blank">Link changes font-size</a></b></p> <p><b><a class = "third" href = "demo3.html" target = "_blank">Link changes background-color</a></b></p> </body> </html>
Advertisements