CSS的需求

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--
	html 在一個網頁中負責的事情是一個頁面的結構。
    css(層疊樣式表)在一個網頁中主要負責了頁面的數據樣式。
  編寫css代碼的方式:
  	第一種:在style標籤中編寫css代碼。	只能用於本頁面中,複用性不強。
    	格式:
        	<style type="text/css">
            	編寫css的代碼
            </style>
        例子:
  			a{
				color:#F00;
				text-decoration:none;
			}
     第二種:可以引入外部的css文件	推薦使用
     	方式一:使用link標籤	推薦使用
        	格式:
            	<link href="css文件的路徑" rel="stylesheet">
            例子:<link href="1css.css" rel="stylesheet"/>
        方式二:使用<style>引入
        	格式:
            	<style type="text/css">
					@import url("css的路徑");
				</style>
            例子:<style type="text/css">
					@import url("1css.css");
				 </style>
     第三種:直接在html標籤使用style屬性編寫		只能用於本標籤中,複用性較差。不推薦使用
            例子:<a style="color:#0F0; text-decoration:none;" href="#">新聞標題2</a>
            	
-->
<!--
<style type="text/css">
	a{
		color:#F39;
		text-decoration:none;
	}
</style>
-->
<!--
<link href="1css.css" rel="stylesheet"/>
-->
<!--
<style type="text/css">
	@import url("1css.css");
</style>
-->
<style type="text/css">
/*
	html的註釋:<!-- html的註釋 -->
	css的註釋:	/* css的註釋... */
*/
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
</head>
<body>
	<h1>標題1</h1>
	<a href="#" ><font color="#FF0000">新聞的標題1</font></a>
    <a style="color:#0F0; text-decoration:none;" href="#">新聞標題2</a>
    <a href="#">新聞標題3</a>
    <a href="#">新聞標題4</a>
</body>
</html>

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