98-100 css外邊距
阿新 • • 發佈:2022-02-07
<!DOCTYPE html> <html lang="en"> <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>外邊距</title> <style> div{ margin: 70px; border: 1px solid red; } p { border: 1px solid rgb(4, 0, 255); margin-top: 100px; margin-bottom: 100px; margin-left: 150px; margin-right: 80px; background-color: brown; } </style> </head> <body> <h1>css外邊距設定 </h1> <div>本div標籤元素的外邊距為 70 畫素。</div> <h2>使用單獨的外邊距屬性</h2> <p>這個p 元素的上外邊距為 100 畫素,下外邊距是 100 畫素,右外邊距是 150 畫素,左外邊距是 80 畫素。</p> </body> </html>
效果