How to underline the a tag and change the color before and after clicking

How to underline the a tag and change the color before and after clicking

Copy code
The code is as follows:

a:link {
font-size: 12px;
color: #000000;
text-decoration: none;
}
a:visited {
font-size: 12px;
color: #000000;
text-decoration: none;
}
a:hover {
font-size: 12px;
color: #999999;
text-decoration: underline;
}

Defining the style sheet in this way can achieve your function. If you don’t know the style sheet, you can add the following code to the <head></head> tag of your page:

Copy code
The code is as follows:

<style type="text/css">
<!--
a:link {
font-size: 12px;
color: #000000;
text-decoration: none;
}
a:visited {
font-size: 12px;
color: #000000;
text-decoration: none;
}
a:hover {
font-size: 12px;
color: #999999;
text-decoration: underline;
}
-->
</style>

<<:  Detailed explanation of the idea of ​​implementing dynamic effect of lyrics progress text color filling change using CSS3

>>:  A brief analysis of Linux network programming functions

Recommend

CSS example code for setting scroll bar style

The CSS implementation code for setting the scrol...

Example of CSS3 to achieve div sliding in and out from bottom to top

1. First, you need to use the target selector of ...

MySQL installation and configuration method graphic tutorial (CentOS7)

1. System environment [root@localhost home]# cat ...

jQuery implements simple button color change

In HTML and CSS, we want to set the color of a bu...

The correct way to use Homebrew in Linux

Many people use Linux Homebrew. Here are three ti...

Tutorial on deploying the open source project Tcloud with Docker on CentOS8

1. Install Docker 1. I installed Centos7 in the v...

JavaScript implements simple date effects

The specific code of JavaScript date effects is f...

CSS Naming: BEM, scoped CSS, CSS modules and CSS-in-JS explained

The scope of css is global. As the project gets b...

Basic usage tutorial of IPTABLES firewall in LINUX

Preface For production VPS with public IP, only t...

CSS tips for implementing Chrome tab bar

This time let’s look at a navigation bar layout w...

Introduction and usage examples of ref and $refs in Vue

Preface In JavaScript, you need to use document.q...

JS implements the rock-paper-scissors game

This article example shares the specific code of ...

MySQL uses init-connect to increase the implementation of access audit function

The mysql connection must first be initialized th...