What is CSS?
Ever wonder how web pages have a specific look and feel with color, fonts, and layout? These features are part of the Cascading Stylesheet (CSS) language. It provides for the separation of the data in HTML from the styling of the data. Thus, developers can define the look of a webpage separately from the text it contains.
There are three ways to write CSS:
- Inline CSS: HTML element is styled;
- Embedded CSS: CSS rules are located in an HTML file; and
- External CSS: CSS is located in an external file. This makes the CSS code easy to maintain and reusable.
We'll look at each type in the following sections.
Introduction
CSS (Cascading Style Sheets) allows you to create great-looking web pages, but how does it work under the hood? This article explains what CSS is, with a simple syntax example, and also covers some key terms about the language.
Prerequisites: | Basic computer literacy, basic software installed, basic knowledge of working with files, and HTML basics (study Introduction to HTML.) |
---|---|
Objective: | To learn what CSS is. |
In the Introduction to HTML module we covered what HTML is, and how it is used to mark up documents. These documents will be readable in a web browser. Headings will look larger than regular text, paragraphs break onto a new line and have space between them. Links are colored and underlined to distinguish them from the rest of the text. What you are seeing is the browser's default styles – very basic styles that the browser applies to HTML to make sure it will be basically readable even if no explicit styling is specified by the author of the page.
Source: Mozilla, https://developer.mozilla.org/en-US/docs/Learn/CSS/First_steps/What_is_CSS
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.