复制代码代码如下: html head meta http-equiv="Content-Type" content="text/html; charset=utf-8" / title Text Demo /title /head body h1 >This is a line of Text. /h1 /body /html
嵌入式:嵌入式则将对页面中各种元素的设置集中写在 head 和 /head 之间,对于单一的网页,这种方法很方便。但是对于一个包含很多页面的网站,如果每个页面都以内嵌方式设置各自的样式,就失去了CSS带来的巨大优点,因此一个网站通常都是编写一个独立的CSS样式表文件,使用以下两种方式中的一种,引入HTML文档中。 例:
复制代码代码如下: html head meta http-equiv="Content-Type" content="text/html; charset=utf-8" / title Text Demo /title style type="text/css" h1{ color:white; background-color:boue; } /style /head body h1 This is a line of Text. /h1 h1 This is another line of Text. /h1 /body /html