CSS基礎入門------01-與HTML的3種結合方式

<!DOCTYPE html>
<html>
  <head>
    <title>01-結合方式1.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<!-- 結合方式1:
		html標籤上加上style屬性. 屬性的值填寫Css代碼.
		所有標籤都有style屬性.
 -->
  </head>
  
  <body>
   <p style="color:red;" > This is my HTML page. </p>
  </body>
</html>


<!DOCTYPE html>
<html>
  <head>
    <title>02-結合方式2.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<!-- 結合方式2:
	使用head標籤中的style標籤.設置頁面樣式.style中填寫css代碼
 -->
 	<style type="text/css">
 		p{
 			color:red;
 		}
 	</style>
  </head>
  
  <body>
   <p> This is my HTML page. </p>
  </body>
</html>

<!DOCTYPE html>
<html>
  <head>
    <title>03-結合方式3.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
<!-- 結合方式3:
 -->
   <link rel="stylesheet" type="text/css" href="p.css">
  </head>
  
  <body>
   <p> This is my HTML page. </p>
  </body>
</html>

運行效果如下


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章