CSS Structure

What is CSS?

CSS=Cascading Style Sheets

Style rules: Selector{declaration;}
Declation: Property:value



css html的圖片搜尋結果



Comments


/*......*/


Inline 

Set style attribute in HTML elements


<h1 style="color:blue">This is a blue headings</h1>



Internal 

Use <style> element in the <head> section

<style>
body {background-color: black;}
h1   {color: blue;}
p    {color: red;}
</style>
</head>



External 


by using an external CSS file

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="styles.css">
</head>
<body>


body {
  background-color: blue;
}
h1 {
  color: blue;
}
{
  color: red;
}

<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
<style>
h1 {
  color: orange;
}
</style>
</head>



Comments