HTML的CSS
HTML4.0后,所有元素的格式化代码均可移除HTML文档,然后一个对立的样式表。
浏览器读到一个样式表,会按样式表对HTML文档进行格式化,再显示出来。
样式表的三种插入方式
1.外部样式表
<head>
<link rel="stylesheet" type="text/css" hred="mystyle.css">
</head>
说明:此方法适用于样式需要被应用到很多页面的情况
2.内部样式表
head部分通过<style>标签定义内部样式表
<head>
<style type="text/css">
body {background-color:red}
p {margin-left:20px}
</style>
</head>
说明:此方法适用于单个HTML文件需要特别样式时
3.内联样式
单个元素使用style属性
<p style="color: red; margin-left: 20px">
This is a paragraph
</p>
说明:此方法适用于个别元素使用特殊样式
---------------------------------------------------------------------------------------------------------------
HTML链接
即超链接,与网络上的另一个文档相连
<a href="url"> Link text</a>
href 属性规定链接的目标
<a href="http://www.cnblogs.com/linyuansun/">Visit blogs</a>
target 属性定义链接的打开方式
<a href="http://www.cnblogs.com/linyuansun/" target="_blank">
Visit blogs</a>
_blank 打开一个新窗口
_parent 显示在上一层窗口中
_top 显示在最上层窗口
name 显示在名字叫name的窗口中
_self 显示在当前窗口,缺省的属性