PDA

View Full Version : External CSS



shuini
02-15-2006, 02:23 AM
I'm new to this thing and I used the Anylink CSS Menu and Anylink Vertical Menu.

The former is an external css and js file and I had no problem getting that to work.

The latter is internal and I made it an external css and js file. However, when i try to import both external css and js files, the former doesn't work. What am i doing wrong? i would really really appreciate your help on this since I'm kinda new to css. thanks

these are the lines i inserted in the head section to import the external files

this didn't work:
<link rel="stylesheet" type="text/css" href="../css/anylink.css, ..css/vertical menu.css"/>
<script type="text/javascript" src="../css/anylink.js, ..css/vertical menu.js">
</script>

this also didn't work:
<link rel="stylesheet" type="text/css" href="../css/anylink.css"/>
<script type="text/javascript" src="../css/anylink.js">
</script>
<link rel="stylesheet" type="text/css" href="../css/vertical menu.css"/>
<script type="text/javascript" src="../css/vertical menu.js">
</script>

Twey
02-15-2006, 11:27 AM
The former obviously won't work: you can't use commas to seperate entries.
The latter looks to be correct; are you sure those files exist?

shuini
02-16-2006, 05:38 AM
The former obviously won't work: you can't use commas to seperate entries.
The latter looks to be correct; are you sure those files exist?

yep. m sure the files exist
it doesn't seem to work

it's possible to import a lot of css files or js files???

Twey
02-16-2006, 01:14 PM
it's possible to import a lot of css files or js files???Yes, but you need a seperate <link> or <script> element for each.
Mooblather.

jscheuer1
02-16-2006, 02:55 PM
Also, if the selectors are the same in one or more external stylesheet, and likewise, if there are conflicts between one or more of the external scripts, there will be problems. Generally, but not always, with the last linked files taking precedence over the others and perhaps working while the earlier linked files become disabled.

Twey
02-16-2006, 05:26 PM
Generally, but not always, with the last linked files taking precedence over the others and perhaps working while the earlier linked files become disabled."Not always?" This is what should always happen - it's how CSS got its name. The ability to override parts of a stylesheet later is one of the most powerful features of CSS.

jscheuer1
02-16-2006, 08:01 PM
"Not always?" This is what should always happen - it's how CSS got its name. The ability to override parts of a stylesheet later is one of the most powerful features of CSS.

I was talking about both externally linked style and external javascript files. With style alone technically, you are correct. However, that refers to like selectors. It could happen that a selector that is more specific and/or more precisely defined in a previously linked style sheet would overcome a more general one in a later sheet.

The bottom line is that, unless things are pretty straight forward, I find that merging the various stylesheets is often the only way to figure out why this or that is happening. And more to the point that, regardless of the order, one can override the other, with like selectors taking precedence in later versions.

Twey
02-16-2006, 08:33 PM
I was talking about both externally linked style and external javascript files.Ah, OK.