woensdag 6 augustus 2014

How to Style Links with CSS – Top 5 Link Styling Properties

We have learned how to create navigation using CSS in the last tutorial. Now in this tutorial we will learn how to style (change color/behavior) of those links present in the navigation bar. Follow the steps provided in this tutorial to style links with CSS.


Steps to style links with CSS


1. First of all, create an html file. You may use any IDE like notepad or notepad ++ or Adobe Dreamweaver to create an html file. In this tutorial, we are using plain notepad that is available on any Windows PC. Open notepad any type following code:


<html>

<head>

<title>CSS tutorial – 10</title>

<link rel=”stylesheet” type=”text/css” href=”css/style.css” />

</head>

<body>

<ul id=”nav“>

<li><a href=”tut10.html”>Home</li>

<li><a href=”#”>About Us</li>

<li><a href=”#”>Gallery</li>

<li><a href=”#”>Contact Us</li>

</ul>

</body>

</html>


And then save the file as .html (eg: tut10.html).


Here,

<link rel=”stylesheet” type=”text/css” href=”css/style.css” /> will link the stylesheet that we are going to create.

<ul> tag is used to create list item and <li> lists each item

We have used id because we don’t want all list items in the webpage to change. We only want to change navigation for now.