Box Model Example

<!DOCTYPE html>
<html>
<head>
  <style>
.box {
  width: 200px;
  height: 100px;
  background: lightblue;
  padding: 20px;
  border: 5px solid black;
  margin: 15px;
}
</style> </head> <body> <div class="box">Box Model Example</div> </body> </html>

Explanation (Box Model):

  • Content → main text/image.
  • Padding → space between content and border.
  • Border → outer line.
  • Margin → space between elements.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *