Forum Moderators: not2easy

Message Too Old, No Replies

multiple stylesheets

         

jbhavin

1:57 pm on Sep 3, 2003 (gmt 0)

10+ Year Member



how do i have multiple style sheets.

basicaly i have twwo navigation bars and for both i want different link and hover properties, i mean the colour, so how i implement to style sheets, shall i use a class id or something like that

BlobFisk

2:13 pm on Sep 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can do this with one stylesheet if you so choose! Just use 2 different link styles. Then your html woul look like <a href=".." class="class1" title="..."> and <a href=".." class="class2" title="...">.

Then in your CSS:

a.class1:link {...}
a.class1:visited {...}
a.class1:hover {...}
a.class1:active {...}

a.class2:link {...}
a.class2:visited {...}
a.class2:hover {...}
a.class2:active {...}

HTH

MatthewHSE

2:21 pm on Sep 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can implement multiple stylesheets using multiple <link> tags (or so I've heard) or by using the @import method.

For your links question, I'd do something like this:

a.headnav:link, a.headnav:visited {
color: #000080;
font-weight: bold;
text-decoration: none;
}

a.headnav:hover, a.headnav:active {
color: #0000dd;
font-weight: bold;
text-decoration: underline;
}

a.sidenav:link, a.sidenav:visited {
color: #ffffff;
font-weight: normal;
text-decoration: underline;
}

a.sidenav:hover, a.sidenav:active {
color: #f0f0f0;
font-weight: normal;
text-decoration: underline;
}

There's some code bloat in the above, but it illustrates how you can create separate classes of your links and specify the properties of each. Like all of CSS, you can create as many classes as you want, but two or three should be absolutely sufficient. There's also no reason all your link classes can't go in the same stylesheet.