<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body { background-color: yellow; }
h1 { background-color: #00ff00; }
h2 { background-color: transparent; }
p { background-color: rgb(250,0,255); }
p.no2 { background-color: gray; padding: 20px; }
</style>
</head>
<body>
<h1>這是標題 1</h1>
<h2>這是標題 2</h2>
<p>這是段落</p>
<p class="no2">這個段落設定了內邊距。</p>
</body>
</html>
yellow、transparent#00ff00rgb(250,0,255)padding 會讓背景色延伸至內邊距區域。