CSS: inline, embedded, external or external parse - SnippetGood most recent 30 from http://snippetgood.com2010-07-30T00:03:08Zhttp://snippetgood.com/feeds/question/111http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://snippetgood.com/questions/111/css-inline-embedded-external-or-external-parseCSS: inline, embedded, external or external parseGwyneth2009-10-19T16:21:35Z2010-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><div style="float: left;" class="left">hi</div>
</code></pre>
<p>embedded:</p>
<pre><code><head>
.left { float: left }
</head>
<body>
<div class="left">hi</div>
</body>
</code></pre>
<p>external:</p>
<pre><code> <head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="left">hi</div>
</body>
</code></pre>
<p>parsing:</p>
<pre><code> ????
</code></pre>
http://snippetgood.com/questions/111/css-inline-embedded-external-or-external-parse/112#112Answer by Greg for CSS: inline, embedded, external or external parseGreg2009-10-19T16:29:14Z2009-10-19T16:29:14Z<p>I don't know much about parsing, but you can combine css stylesheets like this:</p>
<pre><code><link rel=Stylesheet href="global.css" title="combined" />
<link rel=Stylesheet href="nav.css" title="combined" />
<link rel=Stylesheet href="section.css" title="combined" />
</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#134Answer by Antti Sykäri for CSS: inline, embedded, external or external parseAntti Sykäri2009-10-27T23:59:57Z2009-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>