Site icon T4Tutorials.com

Box Model CSS

Let’s see the Box Model implementation in HTML and CSS.

Box Model

.box {
    background-color: pink;
    width: 400px;
    border: 30px solid red;
    padding: 30px;
    margin: 30px;
}

Try it

Width and Height of an Element

img
{
    border: 10px solid purple;
     width: 300px;
     height: 100px;
}

Try it

Exit mobile version