In CSS, you can use the color attribute to set the hyperlink text to white. You only need to add "color: white;" or "color:#FFFFFF;" or "color:rgb( 255, 255, 255)" style is enough.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
css sets the hyperlink text to white
<!DOCTYPE html> <html> <head> <style type="text/css"> a{ background-color: black; color: white; /* color:#FFFFFF; */ } </style> </head> <body> <a href="#">超链接文本</a> </body> </html>
Rendering:
Description: The
#color attribute specifies the color of the text.
This attribute sets the foreground color of an element (in HTML representation, the color of the element's text); raster images are not affected by color. This color also applies to all borders of the element, unless overridden by border-color or another border-color property.
Syntax:
color:颜色值;
In CSS, color values can use color names, percentages, numbers and hexadecimal values. There are four writing methods.
1) Use color names
Although there are currently about 184 named colors, they are truly supported by various browsers and serve as CSS specifications There are only 16 recommended color names, as shown in the table below.
Name | Color | Name Name | Color | Name | Color |
---|---|---|---|---|---|
Pure black | silver | Light gray | navy | Dark blue | |
Light blue | green | Dark Green | lime | Light Green | ##teal |
aqua | 天蓝 | maroon | Crimson | ##red | |
purple | Deep Purple | fuchsia | Magenta | ##olive | Brown Yellow |
明黄 | gray | Dark Gray | white | Shell White | |
It is not recommended to use color names in web pages, especially for large-scale use , to avoid some color names not being parsed by browsers, or different browsers interpreting colors differently. |
color: rgb(100%, 100%, 100%);This statement will red, blue, The three primary colors of green are all set to their maximum values, and the resulting combination is displayed in white. Instead, you can set rgb(0%, 0%, 0%) to black. If the three percentage values are equal, gray will be displayed. Similarly, whichever percentage value is larger will favor which primary color.
3) Use numerical values
color: rgb(255, 255, 255);The above statement will display white. On the contrary, it can be set to rgb(0, 0, 0), will display black. If the three values are equal, the display will be gray. In the same way, whichever value is larger will have a greater proportion of which primary color.
4) Hexadecimal color
color: #ffffff;Which should be in hexadecimal Add a # color symbol in front. The above statement will display white. On the contrary, you can set
#000000
to black, which is described by RGB:color: #RRGGBB;
ranges from 0 to 255. In fact, 255 in decimal is exactly equal to hexadecimal. FF, a hexadecimal color value is equal to 3 groups of such hexadecimal values, which are equal to the three primary colors of red, blue, and green when connected together in order.
(Learning video sharing:
css video tutorial)The above is the detailed content of How to set hyperlink text to white in css. For more information, please follow other related articles on the PHP Chinese website!

If you've ever had to display an interactive animation during a live talk or a class, then you may know that it's not always easy to interact with your slides

With Astro, we can generate most of our site during our build, but have a small bit of server-side code that can handle search functionality using something like Fuse.js. In this demo, we’ll use Fuse to search through a set of personal “bookmarks” th

I wanted to implement a notification message in one of my projects, similar to what you’d see in Google Docs while a document is saving. In other words, a

Some months ago I was on Hacker News (as one does) and I ran across a (now deleted) article about not using if statements. If you’re new to this idea (like I

Since the early days of science fiction, we have fantasized about machines that talk to us. Today it is commonplace. Even so, the technology for making

I remember when Gutenberg was released into core, because I was at WordCamp US that day. A number of months have gone by now, so I imagine more and more of us

The idea behind most of web applications is to fetch data from the database and present it to the user in the best possible way. When we deal with data there

Let's do a little step-by-step of a situation where you can't quite do what seems to make sense, but you can still get it done with CSS trickery. In this


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software