written 6.3 years ago by
binitamayekar
★ 6.6k
|
•
modified 6.2 years ago
|
Cascading Style Sheets (CSS)
- CSS is the language for describing the presentation of Web pages, including colors, layout, and fonts. It allows one to adapt the presentation to different types of devices, such as large screens, small screens.
- CSS is independent of HTML and can be used with any XML-based markup language.
- CSS makes the separation of structure (or content) from presentation.
- Thus with CSS designer has much better control over the layout and appearance of web pages.
- The way by which CSS is included in HTML can be categorized into following three types:
The Internal or Embedded CSS
Advantages of Internal CSS:
- Only one page is affected by stylesheet. Classes and IDs can be used by internal stylesheet.
- There is no need to upload multiple files. HTML and CSS can be in the same file.
Disadvantages of Internal CSS:
- Increased page loading time.
- It affects only one page – not useful if you want to use the same CSS on multiple documents.
The External CSS
Advantages of External CSS:
- External CSS is a “true separation” of style and content.
- Faster loading speed.
- Same .css file can be used on multiple pages.
Disadvantages of External CSS:
- Until external CSS is loaded, the page may not be rendered correctly.
The In-line CSS
Advantages of Inline CSS:
- Useful if you want to test and preview changes.
- Useful for quick-fixes.
Disadvantages of Inline CSS:
- Inline CSS must be applied to every element.
- Inline style sheet mixes the content with the presentation.