CSS Introduction

What is CSS?
CSS, or Cascading Styles Sheets, is a way to style and present HTML. Whereas the HTML is the meaning or content, the style sheet is the presentation of that document.

  • CSS stands for Cascading Style Sheets
  • Styles define how to display HTML elements
  • Styles were added to HTML 4.0 to solve a problem
  • External Style Sheets can save a lot of work
  • External Style Sheets are stored in CSS files

CSS Syntax
A CSS rule set consists of a selector and a declaration block:
The selector points to the HTML element you want to style
The declaration block contains one or more declarations separated by semicolons.
Each declaration includes a property name and a value, separated by a colon
CSS Example
A CSS declaration always ends with a semicolon, and declaration groups are surrounded by curly braces:

p {
     color: red;
     text-align: center;
 }

NOTE
This doesn’t actually do anything visually. The code style tag just tells the browser that we will be defining some CSS to be used on this page.
Creating Internal CSS Code
CSS code is not written the same way as HTML code is. This makes sense because CSS is not HTML, but rather a way of manipulating existing HTML. Below is an example of some simple, yet fully functional, CSS code
CSS Code

<html>
<head>
<style type="text/css">

p {color: white; }
body {background-color: black; }
</style>
</head>
<body>
<p>White text on a black background color!</p>
</body>
</html>

Now all text within a paragraph tag will show up as white! Now an explanation of the CSS code that altered the’s background:

free hd porn

Admin has written 171 articles