table.html
<html>
<head>
<title>table_CSS</title>
<link href="table.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<div class="style1"> <!--div是存放html元素的容器 css用于说明div中元素的样式、布局【位置、颜色、大小】-->
<table>
<tr>
<td>1</td><td>2</td><td>3</td>
</tr>
<tr>
<td>1</td><td>2</td><td>3</td>
</tr>
<tr>
<td>1</td><td>2</td><td>3</td>
</tr>
</table>
</div>
</body>
</html>
table.css
/***样式1**for table**/
.style1
{
width: 300px;
height: 200px;
/*border: 1px Solid red;*/
margin: 20px 0px 0px 20px /**像右移动【上、下、左、右】**/
}
/***父子选择器*表格**/
.style1 table
{
width: 298px;
height: 198px;
border: 1px Solid black;
}
/***父子选择器*行**/
.style1 table td
{
border: 1px Solid black;
text-align: center;
}
阅读(1152) | 评论(0) | 转发(0) |