CSS
Hello and welcome to my blog on CSS. I am going to explain what CSS is and then show how it is used within modern webpages.
CSS stands for "Cascading Style Sheet." Cascading style sheets are used to format the layout of Web Pages. They can be used to define text styles, table sizes, and other aspects of Web pages that previously could only be defined in a page's HTML code.
CSS helps Web developers create a uniform look across several pages of a Web site. Instead of defining the style of each table and each block of text within a page's HTML, commonly used styles need to be defined only once in a CSS document. Once the style is defined in cascading style sheet, it can be used by any page that references the CSS file.
Check out the image below showing a simple CSS:
Sample of CSS |
HTML was NEVER intended to contain tags for formatting a web page. HTML was created to describe the content of a web page, like:
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
When tags like <font>, and color attributes were added to the HTML 3.2 specification, it started a nightmare for web developers. Development of large websites, where fonts and color information were added to every single page, became a long and expensive process.
To solve this problem, the World Wide Web Consortium (W3C) created CSS. CSS was created to specify the document's style, not its content.
In HTML 4.0, and later, all formatting should be removed from the HTML page, and stored in separate CSS files.
The following is a section of code I prepared and below that is what it will look like due to the CSS code.
<!DOCTYPE html>
<html>
<head>
<style>
p{text-align: center;
color: red;}
</style>
</head>
<body>
<p>Every paragraph will be affected by the style.</p>
<p id="para1">Me too!</p>
<p>And me!</p>
</body>
</html>
What the text will look like |