Using an external stylesheet is useful when you want to make style changes to websites with more than one page. It saves time because only the stylesheet needs to be edited to make changes on pages at once.
While any CSS code can be added to the stylesheet, this page shows examples of how to style hyperlinks.
The following code will link your HTML document to the stylesheet.
rel="stylesheet" href="style.css" type="text/css"
Place the link
element into the head
of your HTML document in order to link to the stylesheet (style.css). The above syntax assumes that style.css is in the same directory as your HTML documents. You can specify a different path to style.css by changing the href
value.
If you don't already have a stylesheet connected to your web pages, create a new plain text file, paste the CSS code below into it and Save As style.css. If you can't Save As, simply save it as a normal text file (style.txt) and rename it manually from style.txt to style.css.
If you already have a website stylesheet, additional rules can simply be added to it. Make sure however to back-up your stylesheet before making any changes just in case something goes wrong. To make a back up, copy/paste the entire stylesheet file.
a:link {
color: blue;
text-decoration: underline;
}
a:visited {
color: purple;
text-decoration: underline;
}
a:hover {
color: red;
text-decoration: none;
}
https://www.hyperlinkcode.com/external-stylesheet.php
color: blue, purple, red = Variable color of hyperlink. Color names or hex codes can be used.
text-decoration: none = No underline. underline = Underlined hyperlink.