Tuesday 3 October 2023

CSS Box Model (Margins, Padding and Layouts)

 CSS Box Model (Margins, Padding & Layouts)


CSS Box Model

"In the CSS Box model concept, we consider all HTML elements as box-shaped items. By thinking like that, It is very easy for developers to add margins, padding, and border attributes to those elements."

The CSS box model is essentially a box that wraps around every HTML element. It consists of margins, borders, padding, and the actual content. The image below illustrates the box model. 


Code:- 

Output:- 



Written by:  W.A. Eranga Dewmini

No comments:

Post a Comment

Java Script Learning

 Introduction to JavaScript JavaScript is the programming language used by front-end web developers to instruct the browser to add behaviors...