Learning Center
Learning Center
  • HTML
  • CSS
  • JAVASCRIPT
  • Bootstrap
  • React
  • jQuery
  • NodeJs
  • Sql
  • MySql
  • Python
  • OpenVPN Setup
  • Log In
Coding Choice Home About Contact ☰

  1. You are here
  2. Home
  3. css
  4. box_model

Sidebar
  • Introduction to CSS
  • CSS Selectors
  • CSS Box Model
  • CSS Flexbox
  • CSS Grid
  • CSS Animations
  • Responsive Web Design
  • CSS Cheat Sheet
  • Share via
    • Share via...
    • Twitter
    • LinkedIn
    • Facebook
    • Pinterest
    • Telegram
    • WhatsApp
    • Yammer
    • Reddit
    • Teams
  • Send via e-Mail
  • Print
  • Permalink

CSS Box Model

The CSS box model describes how elements are structured in terms of content, padding, border, and margin.

<!DOCTYPE html>
<html>
<head>
    <style>
        .box {
            width: 200px;
            padding: 10px;
            border: 5px solid black;
            margin: 20px;
        }
    </style>
</head>
<body>
    <div class="box">This is a box!</div>
</body>
</html>