posts - 262,  comments - 221,  trackbacks - 0
          一、HTML中的外部樣式表(External Style Sheet):

          An external style sheet is ideal when the style is applied to many pages. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section.

          <head>
          <link rel="stylesheet" type="text/css"
          href
          ="mystyle.css">
          </head>

          備注:每個引用外部樣式表的HTML文件都會通過一個<link>標簽指向該樣式表文件,該<link>標簽必須位于<head></head>內(nèi)部


          二、HTML中的內(nèi)部樣式表(Internal Style Sheet):

          An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section with the <style> tag.

          <head>
          <style type="text/css">
          body 
          {background-color: red}
          {margin-left: 20px}
          </style>
          </head>

          備注:內(nèi)部樣式表用于需要對單一HTML文件的樣式進行控制時,通過在<head></head>元素中插入<style></style>達到目的

          三、HTML中的內(nèi)嵌樣式表(Inline Styles):

          An inline style should be used when a unique style is to be applied to a single occurrence of an element.To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property.

          <style="color: red; margin-left: 20px">
          This is a paragraph
          </p>

          備注:內(nèi)嵌樣式表用于需要對HTML文件中的某個元素外觀進行微調(diào)時,通過在該HTML元素中制定style屬性的值達到目的



          -------------------------------------------------------------
          生活就像打牌,不是要抓一手好牌,而是要盡力打好一手爛牌。
          posted on 2008-06-22 17:44 Paul Lin 閱讀(384) 評論(0)  編輯  收藏 所屬分類: Web基礎(chǔ)
          <2008年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(21)

          隨筆分類

          隨筆檔案

          BlogJava熱點博客

          好友博客

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 随州市| 永清县| 鹿邑县| 宁陕县| 新龙县| 鄢陵县| 永仁县| 玛曲县| 蕉岭县| 巧家县| 和田县| 鹤岗市| 苍梧县| 始兴县| 眉山市| 竹北市| 三都| 盐山县| 香河县| 闻喜县| 榆中县| 陇南市| 新龙县| 苍南县| 盐城市| 平定县| 通江县| 鞍山市| 临洮县| 大丰市| 德令哈市| 犍为县| 于田县| 江西省| 巴南区| 区。| 罗城| 汾阳市| 黄骅市| 茶陵县| 宜章县|