CSS link Style Tips


cascading style sheet

There are different styles to set on links in different environments:

When we want to set a whole page/divider/table to have a certain link style we use the below CSS:

.MyLink {font-family: arial; font-size: 16px;}

.MyLink a:link{color: black; text-decoration: none;}

.MyLink a:hover{color: black; text-decoration: underline;}

Meanwhile if we would like to add a style to a specific link such as:

<a href=”MyPage.html” class=”MyLink”> My Page </a>

Then the CSS would look like:

a.MyLink:link {color: black; text-decoration: none;}

a.MyLink:hover {color: black; text-decoration: underline; }