How to set the font color of the a tag in html: 1. Use the style attribute to add an inline style to the a tag for modification. The syntax is ".. a>"; 2. Add an internal style to the a tag to modify it, with the syntax "a{color: color value;}".
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
How to set the font color of the a tag in html
1. You can use the style attribute to modify the color of the a tag in html.
The code is as follows:
style='color:颜色'
Example:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <a href='www.php.cn' style='color:red'>这是一个a标签</a> <a href='www.php.cn' style='color:black'>这是一个a标签</a> <a href='www.php.cn' >这是一个a标签</a> </body> </html>
Output result:
2. Passa{color: color value}
Statement settings
The example is as follows:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <style type="text/css"> a{color:#FF0000} </style> <body> <a href="#" >这是一个a标签</a> </body> </html>
Output result:
For more programming-related knowledge, please visit: programming video! !
The above is the detailed content of How to set the font color of the a tag in html. For more information, please follow other related articles on the PHP Chinese website!