实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>CSS对表格的控制</title> <style type="text/css"> /*第一步,给整个表格及内部的单元格加上边框*/ table,th,td { border:1px solid #333; } /*第二步,将所有的边框线进行折叠*/ table { border-collapse: collapse; text-align: center; margin:50px auto; width: 60%; box-shadow: 3px 3px 3px #888; background-image: url(2.jpg); background-repeat: no-repeat; background-size: cover; } table caption { font: 1.8em; font-weight: bolder; margin-bottom: 20px; } th,td { padding: 10px; } div img { border-radius: 50%; box-shadow: 2px 2px 2px 2px #888; width: 150px; padding: 10px; } th { background-color: rgba(155,155,0,0.3); } .green { color:darkgreen; font-weight: bolder; font-size: 1.2em; } </style> </head> <body> <table> <caption>§ 2018年3月22日百度关键字排行榜 §</caption> <div align="center"><img src="3.jpg"></div> <tr> <th>名次</th> <th>网站</th> <th>网址</th> <th>关键字</th> <th>移动指数</th> <th>PC指数</th> <th>收录量</th> </tr> <tr> <td>1</td> <td>浦北社区</td> <td>mi-888.com</td> <td>浦北</td> <td>1000</td> <td>2000</td> <td class="green">128.8万</td> </tr> <tr> <td>2</td> <td>浦北都市网</td> <td>535300.net</td> <td>浦北</td> <td>800</td> <td>1000</td> <td class="green">120万</td> </tr> <tr> <td>3</td> <td>浦北天天网</td> <td>pbtt.net</td> <td>浦北</td> <td>600</td> <td>800</td> <td class="green">100万</td> </tr> <tr> <td>4</td> <td>浦北同城网</td> <td>pbtcw.com</td> <td>浦北</td> <td>400</td> <td>600</td> <td class="green">80万</td> </tr> </table> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例
作业地址:http://mi-888.com/PHP/zuoye/20180322/0322-4.html
手抄代码: