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>内部


二、HTML中的内部样式表(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>

备注:内部样式表用于需要对单一HTML文件的样式进行控制时,通过在<head></head>元素中插入<style></style>达到目的

三、HTML中的内嵌样式表(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>

备注:内嵌样式表用于需要对HTML文件中的某个元素外观进行微调时,通过在该HTML元素中制定style属性的值达到目的



-------------------------------------------------------------
生活就像打牌,不是要抓一手好牌,而是要尽力打好一手烂牌。
posted on 2008-06-22 17:44 Paul Lin 阅读(351) 评论(0)  编辑  收藏 所属分类: Web基础

只有注册用户登录后才能发表评论。


网站导航:
 
<2008年6月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

常用链接

留言簿(21)

随笔分类

随笔档案

BlogJava热点博客

好友博客

搜索

  •  

最新评论

阅读排行榜

评论排行榜