SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict caser85's Avatar
    Join Date
    May 2002
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Attach CSS with an include

    I have an application I am working on right now that was done in ASP. I didn't code the application, but I'm just modifying it for our use. Well, the way that the application includes the CSS is with an ASP include that has all of the styles on another page. Is this a fast way to attach css, or should I rename the styles.asp sheet to styles.css and attach is like a normal css file?

    Thanks,

    Casey

  2. #2
    Xbox why have you forsaken me? moospot's Avatar
    Join Date
    Feb 2001
    Location
    Clearwater, FL
    Posts
    3,615
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm trying to figure out if the ASP page is the same as a CSS text file. If it is, then you can rename it without any problems.

    The include file doesn't make the page any faster because it still loads that file at run-time (when the page loads), just as it would load a CSS file.

  3. #3
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Including it as an ASP files allows you the option to make browser-specific changes to the CSS before it is sent, which could be a big advantage. However, it doesn't sound like that's what it's being used for.

    Another possible benefit is that including it as a CSS file and using the <link> tag means you'll generate a new HTTP request for that file during the load of the page, whereas the current method (ASP include) sends the HTML and CSS all at once. The only tangible benefit that I can see in reducing the number of HTTP requests, though, would be to speed up image loading on a heavily graphical web site.

    Ultimately, there's really no huge reason to go about changing what you've got. However, moving the style code to a seperate CSS file brings you to a more standard way of doing things, which decreases the learning curve for new team members. And it would make a move to a new platform (such as PHP) easier if that was ever something you might end up doing.
    ----Adopt-a-Sig----
    Your message here!

  4. #4
    SitePoint Addict caser85's Avatar
    Join Date
    May 2002
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by randem


    Ultimately, there's really no huge reason to go about changing what you've got. However, moving the style code to a seperate CSS file brings you to a more standard way of doing things, which decreases the learning curve for new team members. And it would make a move to a new platform (such as PHP) easier if that was ever something you might end up doing.
    It sounds like the file in ASP format is getting the job done. I agree with you though, that in future work it might make things complicated. I think I'll just change it to css. It should be easy wiht Dreamweaver using find/replace.


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
  •