源代碼
點擊運行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>教程</title> <style> .div1 { width: 300px; height: 100px; border: 1px solid blue; } .div2 { width: 300px; height: 100px; padding: 50px; border: 1px solid red; } </style> </head> <body> <div class="div1">這個是個較小的框 (width 為 300px ,height 為 100px)。</div> <br> <div class="div2">這個是個較大的框 (width 為 300px ,height 為 100px)。</div> </body> </html>
運行結果