close[x]


CSS

CSS-Home CSS-Environment CSS-Basic syntax CSS-Selector CSS-How To Add CSS CSS-Comment CSS-Color CSS-Background CSS-Font CSS-Text CSS-Boarder CSS-Margin CSS-Padding CSS-Height/Width CSS-Link CSS-Table CSS-Visibility CSS-Scrollable CSS-Float/Clear CSS-Line CSS-Align CSS-Dimension CSS-Event CSS-Pusedo class CSS-Position CSS-Transparency CSS-Dropdown CSS-Form CSS-List/Counter CSS-Website layout CSS-Text effect CSS-Image effect CSS-Button effect CSS-page number CSS-Box CSS-@media CSS-Multi device CSS-Multi device 1 CSS-Multi device 2



learncodehere.com




CSS - Links

links uses to jump to another document.

You can set different properties of a hyper link using CSS.

You can set following properties of a hyper link −

  • a:link - a normal, unvisited link.
  • a:visited - a link the user has visited link.
  • a:hover - a link when the user mouses a:hover - a link when the user mouses over it.
  • a:active - a link on which the user is currently clicking.

  • Example : CSS - Links

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    a:link {
    color: red;
    }
    a:visited {
    color: yellow;
    }
    a:hover {
    color: green;
    }
    a:active {
    color: blue;
    }
    </style>
    </head>
    <body>
    <p>Code Always.<p>
    <p><b><a href=" ../html/linktext.php" target="_blank">This is a link.</a></b></p>
    </body>
    </html>

    When the above code is compiled , it produces the following result.

    Result

    Code Always.

    This is a link.



    CSS - Link Button

    You can create different kind of button links using CSS.


    Example : Link Button

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    a:link {
    background-color: red;
    color: white;
    padding: 14px 25px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    }
    a:hover {
    background-color: green;
    }
    a:active {
    background-color: Yellow;
    }
    </style>
    </head>
    <body>
    <p><b><a href=" /html/linktext.html" target="_blank">Button Link</a></b></p>
    </body>
    </html>

    When the above code is compiled , it produces the following result.

    Result