HTML Basics - Simple Example of Setting Hyperlink Style

HTML Basics - Simple Example of Setting Hyperlink Style

*** Example of setting the style of a hyperlink

a:link The state of a hyperlink before being clicked

a:visited The state after a hyperlink is clicked

a:hover Hovering over a hyperlink

a:active When clicking a hyperlink

There is an order in defining these states.

Code area:

XML/HTML CodeCopy content to clipboard
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >   
  2. < html   xmlns = "http://www.w3.org/1999/xhtml" >   
  3. < head >   
  4. < meta   http-equiv = "Content-Type"   content = "text/html; charset=utf-8"   />   
  5. < title > Untitled Document </ title >   
  6. < style   type = "text/css" >   
  7. a:link
  8. {
  9. color:#000;
  10. text-decoration:none;}
  11. a:visited
  12. {
  13. color:#000;
  14. text-decoration:none;}
  15. a:hover
  16. {
  17. color:#F00;
  18. text-decoration:underline;}
  19. a:active
  20. {
  21. color:#F90;
  22. text-decoration:underline;}
  23. </ style >   
  24. < link   href = "Untitled-1.css"   rel = "stylesheet"   type = "text/css"   />   
  25. </ head >   
  26.   
  27. < body >   
  28. <   href = "http://www.baidu.com/" > Baidu search </ a >   
  29. </ body >   
  30. </ html >   

Running display: When the mouse arrow is not on "Baidu", it displays black - when it is on, it displays red - when you click the "Baidu" link, it displays orange - after clicking, it displays black

The above article on HTML basics - a simple example of setting the style of hyperlinks is all I have to share with you. I hope it can give you a reference, and I also hope that you will support 123WORDPRESS.COM.

Original URL: http://www.cnblogs.com/H2921306656/archive/2016/07/10/5658752.html

<<:  Essential for front-end development: 12 browser compatibility testing tools recommended

>>:  Docker custom network container interconnection

Recommend

Example code for css flex layout with automatic line wrapping

To create a flex container, simply add a display:...

Two ways to enable firewall in Linux service

There are two ways: 1. Service method Check the f...

Analysis of the operating principle and implementation process of Docker Hub

Similar to the code hosting service provided by G...

W3C Tutorial (10): W3C XQuery Activities

XQuery is a language for extracting data from XML...

React mouse multi-selection function configuration method

Generally, lists have selection functions, and si...

Optimization methods when Mysql occupies too high CPU (must read)

When Mysql occupies too much CPU, where should we...

MySQL Optimization: Cache Optimization

I am happy that some bloggers marked my article. ...

Implementation steps for installing FTP server in Ubuntu 14.04

Table of contents Install Software Management Ano...

JavaScript to implement the back to top button

This article shares the specific code for JavaScr...

Several ways to solve the 1px border problem on mobile devices (5 methods)

This article introduces 5 ways to solve the 1px b...

Analysis of MySQL Aborted connection warning log

Preface: Sometimes, the session connected to MySQ...

Example sharing of anchor tag usage in HTML

Anchor tag usage: Linking to a specific location i...

Front-end JavaScript operation principle

Table of contents 1. What is a JavaScript engine?...

Browser compatibility summary of common CSS properties (recommended)

Why do we need to summarize the browser compatibi...