|
Multiple Hyperlink StylesIn this tutorial I will explain what you need to know so that you can create multiple hyperlink behavior styles. Nothing fancy just some simple behaviors. I'll leave the fancy details up to you. Before I get into the details, note that in order for your link styles to behave properly you need to have the CSS styling for your hyperlinks placed in the proper order.
General styling for your hyperlinksHaving a general link style in your CSS is the first step to having multiple link style rules. In order to assign a particular style to all the links contained in a web page you would do something similar to the following in your style sheet.
The above is the best way to style the links that will be contained within your page content. Assigning style rulesThere are two ways to assign hyperlink styles that can be different from the hyperlink styles mentioned above.
Div specific hyperlink style rulesCreating the hyperlink styles and assigning them to a specific div will have all hyperlinks contained within this div follow the specified rules. Doesn't matter if the div is an (#)id or (.) class. For this tutorial I will use a div id named navigation. The CSS for div id navigation
Specific hyperlink stylesOK, so now you want to have a specific styling assigned to a specific type of hyperlink. This can be accomplished by first creating the style rules in your CSS. It is best for this type of hyperlink styling to assign a class and not an id. Remember that an id can only be used once on a page and a class can be used as many times as needed. The CSS for link class styleone
The html for a hyperlink with a class of styleone
The link above will use the style rule class of styleone even if it is placed inside a div that has div specific hyperlink style rules. In summary you can have as many different hyperlink styles as you need. Just create a different set of style rules for each one. |