今天正式進入了CSS也就是我們要開始建構網頁的皮膚,開始幫忙做一些裝飾了,那我們也是從最簡單的CSS會出現在哪裡來介紹
外部
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="css/day1.css" rel="stylesheet">
</head>
<body>
<h1>KK</h1>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Eius quae enim esse. Provident id numquam laboriosam dignissimos animi totam iusto est, velit obcaecati sapiente inventore accusamus quas odit nam atque.</p>
</body>
</html>
<link>我們透過此標籤來連結
href 指定CSS的路徑
rel 連結檔案屬性
body{
color: blue;
}
h1{
color: white;
}
底下屬於CSS的部分
body{
color: blue;
}
將網頁身體的顏色設成藍色
h1{
color: white;
}
大標題設成白色
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
body{
color: blue;
}
h1{
color: white;
}
</style>
</head>
<body>
<h1>KK</h1>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Eius quae enim esse. Provident id numquam laboriosam dignissimos animi totam iusto est, velit obcaecati sapiente inventore accusamus quas odit nam atque.</p>
</body>
</html>
<style type="text/css"></style>這個在述說樣式類型是文字/語法CSS