Forums

This topic is locked

CSS Style Sheets

Posted 01 Jun 2003 14:10:00
1
has voted
01 Jun 2003 14:10:00 Marc Fogel posted:
I want to use style sheets for links on my page. I want to use two different style sheets. One style sheet for some links and the other style sheet for the other links. I cannot get it to work. I can get one style sheet to work for all th links on the page but cannot get both. Can someone post a small example of how this works. I am linking to the style shets.

Thanks
Marc

Replies

Replied 01 Jun 2003 18:53:26
01 Jun 2003 18:53:26 Rammy Nasser replied:
I would not know if this would work by why dont you cut out the tags from one page and insert them in to the other using any text tool?.. hope this helps
Replied 01 Jun 2003 22:32:59
01 Jun 2003 22:32:59 james crellin replied:
paste this into dreamweaver and take a look at the code.

<p><a href="#">james</a> </p>
<p><a href="#"><font color="#FF0000">james 2</font></a></p>

You could also do this using CSS, but this just an html way.

<img src="www.imahosting.com/sigs/lgbrokenfly.gif" border=0>
<b>"I learn so I can help."</b> =- Saleblitz
Replied 01 Jun 2003 22:48:29
01 Jun 2003 22:48:29 james crellin replied:
In order to have a variety of link styles on your web site, you will need to use css. Unfortunately, Dreamweaver won't allow you to add new link styles as classes to your style sheet and you will have to use a text editor, such as NotePad.

Open up your .css file in your text editor.
Copy the following, and edit according to your requirements:
.speciallink {
font-family: verdana, arial, helvetica, sans-serif;
color: #000000;
}

.speciallink A:link {
color: #0099FF;
text-decoration: none;
}

.speciallink A:visited {
color: #9933FF;
text-decoration: none;
}

.speciallink A:hover {
color: #CC0000;
text-decoration: underline;
}

This will create a link style which is blue with no underline on unvisited links, purple with no underline on visited links and turns red with an underline when someone mouses over the link.

n.b.: The hover attribute only works in IE 5+ and Netscape 6+

Save the .css file.
In the html, you will need to make sure that the text you want to apply this style to has the above class specified:
&lt;p class="speciallink"&gt;&lt;a href="www.website.com/"&gt;text to be linked&lt;/a&gt;&lt;/p&gt;

In Dreamweaver, simply highlight the text and apply the style "speciallink". To view the styles, go to Window &gt; CSS Styles from the top toolbar.

n.b: You may need to close the web page and re-open it to see the new styles you have created appear in the CSS Styles list.

When you make any text that is in this style a link, it will display as you specified in the .css file.

<img src="www.imahosting.com/sigs/lgbrokenfly.gif" border=0>
<b>"I learn so I can help."</b> =- Saleblitz

Reply to this topic