CSS
CSS stands for cascading syle sheets. It's a markup language used with HTML to specify how web pages appear, from text color and size to page layout.
Contents |
External CSS
Most CSS is on external style sheets that are linked to from web pages. For example, if you look at the source code of this page, you'll see these links:
<link rel="stylesheet" type="text/css" href="/w/skins/webhostingtalk/whtstyle.css" />
<link rel="stylesheet" type="text/css" href="/w/skins/webhostingtalk/main.css" />
Those pages have CSS for font color and size, page background color, how different parts of the page are to appear, and so on. External CSS has several advantages:
- There is only one page to change, and the change takes place on every page that links to that style sheet. This saves a lot of work for designers.
- When people visit the website, their browsers download the style sheet only once instead of downloading the formatting on the page every time they go to a page. File sizes can be much smaller, so pages download faster.
- Search engines can crawl more content when they have less code to crawl through. Since content closer to the top of the page is given more weight by search engines, having less code is better for SEO too.
Inline CSS
Inline CSS is used in the page source code where the text is. It's sometimes used when the formatting is used for one instance only or because of personal preference. Another use is to override external CSS in just a particular instance.
It may be more convenient to add CSS right with the text, but doing so loses the above advantages of CSS when it's on external style sheets.
Embedded CSS
Embedded CSS is kind of a cross between external and internal CSS. It has just the HTML or perhaps a CSS class indicator, but the CSS formatting is in the <head> section of the page instead of in a separate style sheet. It has the same advantages and disadvantages of inline CSS.
External links
See also
Web Hosting Wiki article text shared under a Creative Commons License.


