主要属性:前景色color,背景色background-color
<html>
<head>
<title>css示例-颜色与背景</title>
<style type="text/css">
h1{
color:#FF0066;
background-color:blue;
}
body{
background-image:url();
background-repeat:repeat-x;
}
</style>
</head>
<body>
<h1>h1 color测试</h1>
背景是一个图片
</body>
</html>
边框
<html>
<head>
<title>css示例-边框</title>
<style type="text/css">
/*表格宽度为1px,实线,黑色*/
table{
border:1px solid black;
border-collapse:collapse;
}
td{
border:1px solid black;
border-collapse:collapse;
}
</style>
</head>
<body>
<table border="1" width="70%">
<tr>
<td>用户代码</td>
<td>用户名称</td>
</tr>
<tr>
<td>001</td>
<td>张三</td>
</tr>
</table>
</body>
</html>
<html>
<head>
<title>css示例-颜色与背景</title>
<style type="text/css">
h1{
color:#FF0066;
background-color:blue;
}
body{
background-image:url();
background-repeat:repeat-x;
}
</style>
</head>
<body>
<h1>h1 color测试</h1>
背景是一个图片
</body>
</html>
边框
<html>
<head>
<title>css示例-边框</title>
<style type="text/css">
/*表格宽度为1px,实线,黑色*/
table{
border:1px solid black;
border-collapse:collapse;
}
td{
border:1px solid black;
border-collapse:collapse;
}
</style>
</head>
<body>
<table border="1" width="70%">
<tr>
<td>用户代码</td>
<td>用户名称</td>
</tr>
<tr>
<td>001</td>
<td>张三</td>
</tr>
</table>
</body>
</html>