一、文本溢出的处理
属性:overflow: ;
值:
visible | 溢出可见 |
scroll | 不管内容是否溢出,都生成滚动条 |
auto | 溢出生成滚动条,不溢出不生成 |
hidden | 溢出隐藏 |
效果:
书写样式:
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.box {
width: 200px;
height: 200px;
border: 1px solid #000;
background-color: #ccc;
overflow: hidden;
}
</style>
</head>
<body>
<div class="box">
春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天春天
</div>
</body>
二、表格边框合并
属性:border-collapse: collapse;
相邻表格边框合并,表格专有属性
collapse 合并
效果:
书写样式:
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
table {
width: 500px;
height: 500px;
border: 1px solid #000;
border-collapse: collapse;
}
td {
border: 1px solid #000;
}
</style>
</head>
<body>
<table>
<!-- table>tr*4>td*4 -->
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>