SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast nosnevel's Avatar
    Join Date
    Aug 2003
    Location
    US
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Link from one CSS file to another

    I want to add some custom CSS to a 2500-line CSS page, but I want to do it as a link, so that when the main CSS page gets updated, my changes don't get overwritten. I don't have access to the page headers, so I want to link fromthe bottom of the original CSS file to the new CSS file. I read about this somewhere, but can't remeber how to do this. Can you help?

    Thanks!
    Larry
    Larry Levenson
    Sigma Web Technologies - Prescott Valley, AZ, USA
    http://www.SigmaWebTechnologies.com

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Code:
    @import url(myotherCSSfile.css);
    Actually I recommend doing the reverse of what you are trying to do:

    Link from the HTML pages to your custom CSS file. In your custom CSS file, put the @import line first, i.e.
    Code:
    @import url(stuff.css);
    body {
      font-size: 100%;
    }
    /*etc*/
    That way your rules will override whatever is in the old/"main" CSS file.

  3. #3
    SitePoint Enthusiast nosnevel's Avatar
    Join Date
    Aug 2003
    Location
    US
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [QUOTE=vgarcia;3266415]
    Code:
    @import url(myotherCSSfile.css);
    So I can use the above code IN AN EXISTING CSS file to link to another CSS file?
    Code:
    //main.css
    
    body {background-color: green}
    p {color: white}
    
    @import url(myotherCSSfile.css);
    Would this snippet link to myotherCSSfile.css?? If not, what should the code be to do this?

    Thanks!
    Larry
    Larry Levenson
    Sigma Web Technologies - Prescott Valley, AZ, USA
    http://www.SigmaWebTechnologies.com


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
  •