<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="css/style.css"> <title>7-1</title> </head> <body> <table border="1"> <tr> <td> 留白 padding </td> </tr> </table> </body> </html>
style.css
td{ /*註解*/ /*padding: 30px 160px;*/ /* padding-top:10px; padding-right:20px; padding-bottom:30px; padding-left:40px;*/ padding: 10px 20px 30px 40px; /*border:solid 10px #1a3f70;*/ border-width:10px; border-color: #000; border-top-style: dotted; border-left-style: double; }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="css/style.css"> <title>7-2</title> </head> <body> <table> <tr> <td> <!-- 註解 --> 留白 padding </td> </tr> </table> <div class="d1"> </div> <div id="d2"> </div> </body> </html>
style.css
td{ /*註解*/ /*padding: 30px 160px;*/ /* padding-top:10px; padding-right:20px; padding-bottom:30px; padding-left:40px;*/ padding: 10px 20px 30px 40px; /*border:solid 10px #1a3f70;*/ border-width:10px; border-color: #000; border-top-style: dotted; border-left-style: double; } .d1{ width: 100px; height: 100px; background-color: #34701a; margin: 20px; } #d2{ width: 500px; height: 500px; background-color: #af7de0; }