Results 1 to 8 of 8

Thread: External CSS

  1. #1
    Join Date
    Feb 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default External CSS

    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>

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Feb 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    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???

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    PLEASE: Include the URL to your problematic webpage that you want help with.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Quote Originally Posted by John
    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey
    "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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I was talking about both externally linked style and external javascript files.
    Ah, OK.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •