Is there importantace of using CSS in a seperate file or embedged in the document

Discussion in 'CSS' started by marzooq, Jun 11, 2007.

  1. #1
    i have been trying to learn CSS for a while. since its easy for me i tried using CSS in the document. but now i realised if i want to custermise it later i have a problem. is this the reason why css is used as external file
     
    marzooq, Jun 11, 2007 IP
  2. smalldog

    smalldog Peon

    Messages:
    66
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello marzooq, there are two main reasons why to use an external CSS file:

    1) You will save an internet traffic, because in case of external CSS file, browser will download this file only once, but in case of embedged CSS file browser will download the definitions always.

    2) If you have for example 20 static html files with an embedged CSS definitions and you want to make some changes, you must edit each of all 20 html files, instead of edit just 1 external CSS file. (that's what you are talking about)

    Hope this informations helps. :)
     
    smalldog, Jun 11, 2007 IP
  3. duilen

    duilen Active Member

    Messages:
    354
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #3
    External CSS may also help in terms of SEO by giving you an optimal code to content ratio but that is up for debate. smalldog covered the two most important points imo.
     
    duilen, Jun 11, 2007 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Actually it does have a benefit from an SEO standpoint - less code directly in the Web page for the spider to go through. :)
     
    Dan Schulz, Jun 11, 2007 IP
  5. demonhale

    demonhale Peon

    Messages:
    352
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes, light web pages with external stylesheets good for SEO and convenient when you want to change the overall theme of your site with just editing one file...
     
    demonhale, Jun 11, 2007 IP
  6. PadraigCurran

    PadraigCurran Peon

    Messages:
    250
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Yeah, external stylesheets save time, bandwidth and money!
     
    PadraigCurran, Jun 14, 2007 IP