Closed Thread Icon

Preserved Topic: ssi and css help!? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=20977" title="Pages that link to Preserved Topic: ssi and css help!? (Page 1 of 1)" rel="nofollow" >Preserved Topic: ssi and css help!? <span class="small">(Page 1 of 1)</span>\

 
brad_nelson1
Nervous Wreck (II) Inmate

From: jax, fl usa
Insane since: May 2001

posted posted 06-07-2001 08:58

hi peeps,

i have a general knowledge of CSS. but im stuck on this.


i have a shtml file(index.shtml) with a navagation menu that is being pulled from SSI. The navagation html file is named nav.html. I want all the LINKS in nav.html to be yellow. So i created a css file called nav.css and told it to make LINKS yellow. i then went into nav.html and put the following command in between the <head> tags:

<link rel="stylesheet" type="text/css" href="../nav.css">

it works but it also makes the other html file's (index.html) links yellow.


what am i doing wrong?

Brad Nelson



[This message has been edited by brad_nelson1 (edited 06-07-2001).]

avidal
Bipolar (III) Inmate

From: austin, tx, usa
Insane since: Nov 2000

posted posted 06-07-2001 12:54

well, just by including the .css file, it activates all the links on the site. what you have to do is define a new ID for the nav links. i.e.

////nav.css//////

<style type="text/css">
.nav{ color: yellow; text-decoration: none }
</style>

////end nav.css////

then, in nav.html, wherever you have a link you want yellow, put this:
<a href="#" id="nav">blah</a>

i think that'll work. i'm not sure though.

timothymcnulty
Neurotic (0) Inmate
Newly admitted
posted posted 06-07-2001 14:21

once index.shtml is executed by the web server it calls all of the code inside of nav.html and includes it inside of index.shtml. this basically turns these two files into one...index.shtml.

your links are getting colored in index.shtml, because *it* contains the call to the css file now, not nav.html....nav.html does not exist anymore.

Do what avidal said...except the <a> should look like this:

<a href="#" class="nav">blah</a>

Depending on how many links you have in nav.html and how often they change, it could get sort of annoying having to remember to add the css...

---hey all, been a while...

linear
Paranoid (IV) Inmate

From: other places
Insane since: Mar 2001

posted posted 06-07-2001 16:29

Hi McNulty.

I want to expand on why setting the class is more correct than setting the ID.

ID is intended more for selecting one element out of the document. While you can use it on multiple elements (and there are timed to do that), it complicates access to the individual elements later in script.

Class is intended to identify a group of elements that share CSS attributes.

The important thing to know is that ID takes precedence over Class when there are potential conflicts. This is in keepeing with the idea that semantically class selects groups while ID selects individual elements.

You could have 46 DIVs of class foo, and one of them with ID bar, and use only two rules to set that up. What's more, if bar was a member of the foo class, you would only need to specify the properties that were different somehow than the foo class.

Hope that helps.

timothymcnulty
Neurotic (0) Inmate
Newly admitted
posted posted 06-09-2001 08:18

thanks for giving an explanation linear...i should have done that myself, but well....i was posting in between meetings...doh!?!

~Age doesn't always bring wisdom. Sometimes age comes alone.~

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 06-11-2001 16:09

brad_nelson1 -

Once you get that working, put all the CSS into one .css file. That makes for cleaner design and less calls to the server.

« BackwardsOnwards »

Show Forum Drop Down Menu