dcsimg
www.webdeveloper.com
Results 1 to 10 of 10

Thread: Internal or External CSS

  1. #1
    Join Date
    Sep 2004
    Location
    At the corner of WALK and DONT WALK
    Posts
    1,741

    Internal or External CSS

    If you have a layout that is in use only on one HTML document, is it better to set it up in an internal style sheet in the head, or make an external style sheet specifically for that document?

    I've got style sheets up the yin yang already, so adding a few more won't matter.

  2. #2
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    It generally won't matter because it's used on a single page UNLESS the sheet is rather large relative to the page size and the page is continuously revisited.

  3. #3
    Join Date
    Sep 2004
    Location
    At the corner of WALK and DONT WALK
    Posts
    1,741
    It IS a rather large style sheet, and I'm expecting a quite a few visits to this page. (My contact page.)

  4. #4
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    If the page is likely to get multiple visits per user, than you can put it in an external sheet. If it's rather large, you might want to separate it just for ease of maintanancce.

  5. #5
    Join Date
    Sep 2004
    Location
    At the corner of WALK and DONT WALK
    Posts
    1,741
    What if you get multiple visits, but the internal sheet's really small?

  6. #6
    Join Date
    Jul 2003
    Location
    Boston Area, Massachusetts
    Posts
    3,489
    I agree with Ray. It'd only make sense to include it on mutliple pages so you could make global changes with ease (and of course, save bandwidth). However, if it's only being used on one page there is no need to make it external.

  7. #7
    Join Date
    Nov 2002
    Location
    XYZZY - UK
    Posts
    1,760
    That's the only time you should add internal CSS when it will only affect one or two pages even then it's still better to use external especially should you want to change to XHTML.

  8. #8
    Join Date
    Sep 2004
    Location
    At the corner of WALK and DONT WALK
    Posts
    1,741
    Originally posted by Robert Wellock
    ...especially should you want to change to XHTML.
    I'm already using XHTML 1.0

  9. #9
    Join Date
    Nov 2004
    Location
    i'll take it to my grave!
    Posts
    4
    ya it doesn't really matter....

  10. #10
    Join Date
    Feb 2003
    Location
    Michigan, USA
    Posts
    5,774
    I'd go for an external CSS file if two conditions exist:

    1) The CSS required is large in file size

    2) The single page it formats gets updated frequently.

    If you are constantly changing the content and not the design, it's beneficial to keep your CSS separate so that the markup and design don't have to be downloaded each time you update the page.

    Otherwise, keep the CSS inside the HTML file. That's one less trip back to the server to retrieve a file. Sometimes the time saved by using an external CSS file is eaten up by the number of times a browser has to make requests to a Web server for additional files.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles