HTML5屬性:margin屬性怎么用?這個問題可能是我們日常學習或工作經常見到的。希望通過這個問題能讓你收獲頗深。下面是小編給大家帶來的參考內容,讓我們一起來看看吧!
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> p{ width: 100px; height: 100px; background-color: red; /* 外邊距 */ margin-top: 30px; margin-left: 100px; margin-right: 100px; margin-bottom: 100px; /* 連寫 */ margin: 40px; margin: 0 auto; /* 內邊距 pandding */ padding: 30px; } </style> </head> <body> <p>p第一個</p> <p>p第二個</p> </body> </html>
運行效果如下:
感謝各位的閱讀!看完上述內容,你們對HTML5屬性:margin屬性怎么用大概了解了嗎?希望文章內容對大家有所幫助。如果想了解更多相關文章內容,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。