Page 76 - TP-Play_V-2.0_Book-8
P. 76

</BODY>
            </HTML>
            When we click on any link, we will reach to linked section as shown:


























                                                           Output
            You can also use the different CSS properties to change the colour of hyperlinks in different states.
            There are mainly four states of hyperlinks which are link, visited link, hover and active. By using the
            following CSS properties, you can change the look and style of hyperlinks in different states:

               ✶ a:link: It is used to set the style for an unvisited link.
               ✶ a:visited: It is used to set the style on a link which the user has visited.
               ✶ a:hover: It is used to set the style on a link when mouse pointer moves over it.
               ✶ a:active: It is used to set the style on a link when it is clicked.

            Let us create a web page to use all these properties.
            <!DOCTYPE html>
            <HTML>

            <HEAD>
            <STYLE>
            a:link, a:visited {

              background-color: pink;
              color: red;
              padding: 20px 22px;
              text-align: center;

              text-decoration: underline;
              display: inline-block;
            }
            a:hover, a:active {

              background-color: green;
              color:orange;

             76       Play (Ver. 2.0)-VIII
   71   72   73   74   75   76   77   78   79   80   81