1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Inline CSS and External CSS file

Discussion in 'CSS' started by markup, Feb 11, 2012.

  1. #1
    I need to know the HTML rending speeds and performance when I use inline css and external CSS file. For example I have one page website and size of the CSS code is 1 KB . So I can put it as inline CSS and put as external CSS file

    Can anyone explain what is giving the best performance ?
     
    markup, Feb 11, 2012 IP
  2. Austiner316

    Austiner316 Well-Known Member

    Messages:
    136
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    136
    Digital Goods:
    1
    #2
    It should be the same thing, although with external css you will have a more readable and understandable coding which in the long run can be edited by you making changes very quick, and also for best practices.
     
    Austiner316, Feb 11, 2012 IP
  3. nemanja.todic

    nemanja.todic Well-Known Member

    Messages:
    69
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    130
    #3
    External CSS is always the best choice. You should use inline CSS only when you absolutely need to( usually to override some property on some HTML element).

    External CSS are also faster. Sure, web browser need to create an additional request to get file content but you can tell browser to cache that file, so user will load your CSS only once and HTML file will be lighter so generally your website will response faster with external CSS files.

    AUstiner316 point is in my opinion crucial. Also you should explore tools like SASS and COMPASS for taking your CSS to the next level. :)
     
    nemanja.todic, Feb 11, 2012 IP
  4. mobilej

    mobilej Well-Known Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    126
    #4
    Yes, you got a point. It is always easier to edit one page rather than editing all your website pages when making changes.
     
    mobilej, Feb 12, 2012 IP
  5. themetribe

    themetribe Peon

    Messages:
    99
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    technically it's the same, but i might consider external is much more faster because it can affect more than one web page as long as it is linked with.
     
    themetribe, Feb 15, 2012 IP
  6. cssbros

    cssbros Member

    Messages:
    76
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    43
    #6
    Hi

    Using external css is the best way to manage, update and speed your html.
    Inline css is way too messy, and we need codes to be clean, semantic, and well structured.

    Cheers,
     
    cssbros, Feb 17, 2012 IP
  7. amilyjoe

    amilyjoe Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Inline and External CSS both can give advantages if you know when to use them. Use inline if your website have a single page but in multiple web pages website you should use external css because it add symmetry throughout website, make the formatting simple and less error prone.
     
    amilyjoe, Feb 24, 2012 IP