日期:2014-05-17  浏览次数:20609 次

css 基础一

1、链接外部样式。

<head>
<title>文档标题</title>
<link rel=stylesheet href="http://www.dhtmlet.com/dhtmlet.css" type="text/css">
</head>


特点:格式与代码分离。

2、定义内部样式块对象。

<html>
<head>
<title>文档标题</title>
<style type="text/css">
<!–
body {font: 10px "Arial"}
h1 {font: 15px/17px "Arial"; font-weight: bold; color: maroon}
h2 {font: 13px/15px "Arial"; font-weight: bold; color: blue}
p {font: 10px/12px "Arial"; color: black}
–>
</style>
</head>
<body>


特点:页面内部使用,方便,下载流量会适当减少。

3、内联定义。

<p style="margin-left: 0.5in; margin-right:0.5in">这一行被增加了左右的外补丁<p>


特点:随意、方便。

?

转自:http://www.iteye.com/topic/675248