CSS: inline, embedded, external or external parse - SnippetGood most recent 30 from http://snippetgood.com 2010-07-30T00:03:08Z http://snippetgood.com/feeds/question/111 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://snippetgood.com/questions/111/css-inline-embedded-external-or-external-parse CSS: inline, embedded, external or external parse Gwyneth 2009-10-19T16:21:35Z 2010-07-21T13:22:20Z <p>I was thinking about server load times and wondering what the most efficient way to add css is. What gets loaded fastest?</p> <p>For my part, I think the external css is the easiest to maintain as a project scales, but sometimes you need a lot of these stylesheets for large scale websites with a lot of varying sections. What about parsing several css sheets on load?</p> <p>as for snippets:</p> <p>inline:</p> <pre><code>&lt;div style="float: left;" class="left"&gt;hi&lt;/div&gt; </code></pre> <p>embedded:</p> <pre><code>&lt;head&gt; .left { float: left } &lt;/head&gt; &lt;body&gt; &lt;div class="left"&gt;hi&lt;/div&gt; &lt;/body&gt; </code></pre> <p>external:</p> <pre><code> &lt;head&gt; &lt;link rel="stylesheet" type="text/css" href="style.css"&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="left"&gt;hi&lt;/div&gt; &lt;/body&gt; </code></pre> <p>parsing:</p> <pre><code> ???? </code></pre> http://snippetgood.com/questions/111/css-inline-embedded-external-or-external-parse/112#112 Answer by Greg for CSS: inline, embedded, external or external parse Greg 2009-10-19T16:29:14Z 2009-10-19T16:29:14Z <p>I don't know much about parsing, but you can combine css stylesheets like this:</p> <pre><code>&lt;link rel=Stylesheet href="global.css" title="combined" /&gt; &lt;link rel=Stylesheet href="nav.css" title="combined" /&gt; &lt;link rel=Stylesheet href="section.css" title="combined" /&gt; </code></pre> <p>This might be a really old-school out of date method, but I thought I'd log it in here for completeness</p> http://snippetgood.com/questions/111/css-inline-embedded-external-or-external-parse/134#134 Answer by Antti Sykäri for CSS: inline, embedded, external or external parse Antti Sykäri 2009-10-27T23:59:57Z 2009-10-28T00:08:15Z <p>The Google Page Speed project has a list of web performance best practices:</p> <p><a href="http://code.google.com/speed/page-speed/docs/rules_intro.html" rel="nofollow">http://code.google.com/speed/page-speed/docs/rules_intro.html</a></p> <p>Other useful tools you can use to measure your performance are Firebug (getfirebug.com) and YSlow (developer.yahoo.com/yslow/).</p>