SlideShare a Scribd company logo
CSS- Cascading Style Sheet
CSS Box Model
CSS Box Model
• All HTML elements can be considered as boxes. In CSS, the
term "box model" is used when talking about design and
layout.
• The CSS box model is essentially a box that wraps around
every HTML element. It consists of: margins, borders,
padding, and the actual content.
Call US: +91-9915337448 Email Us: info@webtechlearning.com
CSS Box Model
The image below illustrates the box model:
Call US: +91-9915337448 Email Us: info@webtechlearning.com
CONTENT
PADDING
MARGIN
Explanation of the different parts:
• Content - The content of the box, where text and
images appear
• Padding - Clears an area around the content. The
padding is transparent
• Border - A border that goes around the padding and
content
• Margin - Clears an area outside the border. The
margin is transparent
Call US: +91-9915337448 Email Us: info@webtechlearning.com
Explanation of the different parts:
• The box model allows us to add a border around
elements, and to define space between elements.
Call US: +91-9915337448 Email Us: info@webtechlearning.com
div {
width: 300px;
padding: 25px;
border: 25px solid navy;
margin: 25px;
}
Width and Height of an Element
• In order to set the width and height of an element
correctly in all browsers, you need to know how the box
model works.
• Important: When you set the width and height
properties of an element with CSS, you just set the width
and height of the content area. To calculate the full size
of an element, you must also add padding, borders and
margins.
Call US: +91-9915337448 Email Us: info@webtechlearning.com
Maths
320px (width)
+ 20px (left + right padding)
+ 10px (left + right border)
+ 0px (left + right margin)
= 350px
Call US: +91-9915337448 Email Us: info@webtechlearning.com
div {
width: 320px;
padding: 10px;
border: 5px solid gray;
margin: 0;
}
MATHS
• The total width of an element should be calculated like this:
• Total element width = width + left padding + right padding + left border +
right border + left margin + right margin.
• The total height of an element should be calculated like this:
• Total element height = height + top padding + bottom padding + top
border + bottom border + top margin + bottom margin
Call US: +91-9915337448 Email Us: info@webtechlearning.com
Css box-model

More Related Content

What's hot

Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Gil Fink
 
Html frames
Html framesHtml frames
Html frames
eShikshak
 
Html images syntax
Html images syntaxHtml images syntax
Html images syntax
JayjZens
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
Eliran Eliassy
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
 
Html forms
Html formsHtml forms
Html5 semantics
Html5 semanticsHtml5 semantics
Html5 semantics
Webtech Learning
 
Css
CssCss
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
Salman Memon
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Amit Tyagi
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
Knoldus Inc.
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
Mario Hernandez
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
abhilashagupta
 
Javascript arrays
Javascript arraysJavascript arrays
Javascript arrays
Hassan Dar
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Andres Baravalle
 
Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)
Timbal Mayank
 
Bootstrap PPT Part - 2
Bootstrap PPT Part - 2Bootstrap PPT Part - 2
Bootstrap PPT Part - 2
EPAM Systems
 

What's hot (20)

Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Html frames
Html framesHtml frames
Html frames
 
Html images syntax
Html images syntaxHtml images syntax
Html images syntax
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Html forms
Html formsHtml forms
Html forms
 
Html5 semantics
Html5 semanticsHtml5 semantics
Html5 semantics
 
Css
CssCss
Css
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
Id and class selector
Id and class selectorId and class selector
Id and class selector
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
CSS
CSSCSS
CSS
 
Javascript arrays
Javascript arraysJavascript arrays
Javascript arrays
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)
 
Bootstrap PPT Part - 2
Bootstrap PPT Part - 2Bootstrap PPT Part - 2
Bootstrap PPT Part - 2
 

Viewers also liked

CSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box ModelCSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box Modeljamiecavanaugh
 
The Box Model [CSS Introduction]
The Box Model [CSS Introduction]The Box Model [CSS Introduction]
The Box Model [CSS Introduction]
Nicole Ryan
 
CSS Box Model and Dimensions
CSS Box Model and DimensionsCSS Box Model and Dimensions
CSS Box Model and DimensionsGerson Abesamis
 
The CSS Box Model
The CSS Box ModelThe CSS Box Model
The CSS Box Model
Graeme Smith
 
CSS Box Model Presentation
CSS Box Model PresentationCSS Box Model Presentation
CSS Box Model Presentation
Reed Crouch
 
CSS Layouting #3 : Box Model
CSS Layouting #3 : Box ModelCSS Layouting #3 : Box Model
CSS Layouting #3 : Box Model
Sandhika Galih
 
5.1 css box model
5.1 css box model5.1 css box model
5.1 css box modelBulldogs83
 
Building web applications using the web.
Building web applications using the web.Building web applications using the web.
Building web applications using the web.
Christian Heilmann
 
Semantic UI Introduction
Semantic UI IntroductionSemantic UI Introduction
Semantic UI Introduction
Christen Gjølbye Christensen
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
LearningTech
 
Css page layout
Css page layoutCss page layout
Css page layout
Thiện Thành Thật
 
Page Layout 2010
Page Layout 2010Page Layout 2010
Page Layout 2010Cathie101
 
Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computersAkash Varaiya
 
Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and Style
Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and StyleLesson One Fourth Quarter Fourth Year High School CSS Modern Layout and Style
Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and StylePerry Mallari
 
Introduction to computers new 2010
Introduction to computers new 2010Introduction to computers new 2010
Introduction to computers new 2010Cyrus Kyle
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)
Reshmi Rajan
 
End User Computing (EUC)
End User Computing (EUC)End User Computing (EUC)
End User Computing (EUC)
Jashisha Gupta
 

Viewers also liked (20)

CSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box ModelCSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box Model
 
The Box Model [CSS Introduction]
The Box Model [CSS Introduction]The Box Model [CSS Introduction]
The Box Model [CSS Introduction]
 
CSS Box Model and Dimensions
CSS Box Model and DimensionsCSS Box Model and Dimensions
CSS Box Model and Dimensions
 
The CSS Box Model
The CSS Box ModelThe CSS Box Model
The CSS Box Model
 
CSS Box Model Presentation
CSS Box Model PresentationCSS Box Model Presentation
CSS Box Model Presentation
 
CSS Box Model
CSS Box ModelCSS Box Model
CSS Box Model
 
Css box model
Css  box modelCss  box model
Css box model
 
CSS Layouting #3 : Box Model
CSS Layouting #3 : Box ModelCSS Layouting #3 : Box Model
CSS Layouting #3 : Box Model
 
5.1 css box model
5.1 css box model5.1 css box model
5.1 css box model
 
C S S1
C S S1C S S1
C S S1
 
Building web applications using the web.
Building web applications using the web.Building web applications using the web.
Building web applications using the web.
 
Semantic UI Introduction
Semantic UI IntroductionSemantic UI Introduction
Semantic UI Introduction
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
 
Css page layout
Css page layoutCss page layout
Css page layout
 
Page Layout 2010
Page Layout 2010Page Layout 2010
Page Layout 2010
 
Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computers
 
Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and Style
Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and StyleLesson One Fourth Quarter Fourth Year High School CSS Modern Layout and Style
Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and Style
 
Introduction to computers new 2010
Introduction to computers new 2010Introduction to computers new 2010
Introduction to computers new 2010
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)
 
End User Computing (EUC)
End User Computing (EUC)End User Computing (EUC)
End User Computing (EUC)
 

Similar to Css box-model

CSS: Box Model
CSS: Box ModelCSS: Box Model
CSS: Box Model
utsav singh
 
Css box-sizing
Css box-sizingCss box-sizing
Css box-sizing
Webtech Learning
 
Css
CssCss
Css intro
Css introCss intro
Css intro
Julia Vi
 
Dimensions of elements.pdf
Dimensions of elements.pdfDimensions of elements.pdf
CSS workshop @ OutSystems
CSS workshop @ OutSystemsCSS workshop @ OutSystems
CSS workshop @ OutSystems
Ruben Goncalves
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
Yoeung Vibol
 
Getting Started With CSS
Getting Started With CSSGetting Started With CSS
Getting Started With CSS
Trisha Crowley
 
CSS
CSSCSS
Web Programming& Scripting Lab
Web Programming& Scripting LabWeb Programming& Scripting Lab
Web Programming& Scripting Lab
Swapnali Pawar
 
Css methods architecture
Css methods architectureCss methods architecture
Css methods architecture
Lasha Sumbadze
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
Hawkman Academy
 
Css margins
Css marginsCss margins
Css margins
Webtech Learning
 
CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2Shawn Calvert
 
Responsive Web Design (April 18th, Los Angeles)
Responsive Web Design (April 18th, Los Angeles)Responsive Web Design (April 18th, Los Angeles)
Responsive Web Design (April 18th, Los Angeles)
Thinkful
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflowPeter Kaizer
 
Web Development - Lecture 6
Web Development - Lecture 6Web Development - Lecture 6
Web Development - Lecture 6
Syed Shahzaib Sohail
 
Web Development - Lecture 5
Web Development - Lecture 5Web Development - Lecture 5
Web Development - Lecture 5
Syed Shahzaib Sohail
 
Css
CssCss

Similar to Css box-model (20)

CSS: Box Model
CSS: Box ModelCSS: Box Model
CSS: Box Model
 
Css box-sizing
Css box-sizingCss box-sizing
Css box-sizing
 
Css box model
Css box modelCss box model
Css box model
 
Css
CssCss
Css
 
Css intro
Css introCss intro
Css intro
 
Dimensions of elements.pdf
Dimensions of elements.pdfDimensions of elements.pdf
Dimensions of elements.pdf
 
CSS workshop @ OutSystems
CSS workshop @ OutSystemsCSS workshop @ OutSystems
CSS workshop @ OutSystems
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
 
Getting Started With CSS
Getting Started With CSSGetting Started With CSS
Getting Started With CSS
 
CSS
CSSCSS
CSS
 
Web Programming& Scripting Lab
Web Programming& Scripting LabWeb Programming& Scripting Lab
Web Programming& Scripting Lab
 
Css methods architecture
Css methods architectureCss methods architecture
Css methods architecture
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
 
Css margins
Css marginsCss margins
Css margins
 
CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2
 
Responsive Web Design (April 18th, Los Angeles)
Responsive Web Design (April 18th, Los Angeles)Responsive Web Design (April 18th, Los Angeles)
Responsive Web Design (April 18th, Los Angeles)
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflow
 
Web Development - Lecture 6
Web Development - Lecture 6Web Development - Lecture 6
Web Development - Lecture 6
 
Web Development - Lecture 5
Web Development - Lecture 5Web Development - Lecture 5
Web Development - Lecture 5
 
Css
CssCss
Css
 

More from Webtech Learning

Benefits of Digital Marketing
Benefits of Digital MarketingBenefits of Digital Marketing
Benefits of Digital Marketing
Webtech Learning
 
Digital Marketing Benefits
Digital Marketing  BenefitsDigital Marketing  Benefits
Digital Marketing Benefits
Webtech Learning
 
Future Scope of Digital Marketing in India
Future Scope of Digital Marketing in IndiaFuture Scope of Digital Marketing in India
Future Scope of Digital Marketing in India
Webtech Learning
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
Webtech Learning
 
Bootstrap webtech presentation - new
Bootstrap   webtech presentation - newBootstrap   webtech presentation - new
Bootstrap webtech presentation - new
Webtech Learning
 
Css presentation
Css presentationCss presentation
Css presentation
Webtech Learning
 
Client side & Server side Scripting
Client side & Server side Scripting Client side & Server side Scripting
Client side & Server side Scripting
Webtech Learning
 
Software testing & Quality Assurance
Software testing & Quality Assurance Software testing & Quality Assurance
Software testing & Quality Assurance
Webtech Learning
 
Shadows Effects in CSS
Shadows Effects in CSSShadows Effects in CSS
Shadows Effects in CSS
Webtech Learning
 
Bs Typography
Bs TypographyBs Typography
Bs Typography
Webtech Learning
 
Bootstrap grids
Bootstrap gridsBootstrap grids
Bootstrap grids
Webtech Learning
 
Html formatting
Html formattingHtml formatting
Html formatting
Webtech Learning
 
Css position
Css positionCss position
Css position
Webtech Learning
 
Css Display Property
Css Display PropertyCss Display Property
Css Display Property
Webtech Learning
 
Html media
Html mediaHtml media
Html media
Webtech Learning
 
Css floats
Css floatsCss floats
Css floats
Webtech Learning
 
Css pseudo-classes
Css pseudo-classesCss pseudo-classes
Css pseudo-classes
Webtech Learning
 
Wordpress installation
Wordpress installationWordpress installation
Wordpress installation
Webtech Learning
 
Html tags or elements
Html tags or elementsHtml tags or elements
Html tags or elements
Webtech Learning
 
HTML Block and Inline Elements
HTML Block and Inline ElementsHTML Block and Inline Elements
HTML Block and Inline Elements
Webtech Learning
 

More from Webtech Learning (20)

Benefits of Digital Marketing
Benefits of Digital MarketingBenefits of Digital Marketing
Benefits of Digital Marketing
 
Digital Marketing Benefits
Digital Marketing  BenefitsDigital Marketing  Benefits
Digital Marketing Benefits
 
Future Scope of Digital Marketing in India
Future Scope of Digital Marketing in IndiaFuture Scope of Digital Marketing in India
Future Scope of Digital Marketing in India
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 
Bootstrap webtech presentation - new
Bootstrap   webtech presentation - newBootstrap   webtech presentation - new
Bootstrap webtech presentation - new
 
Css presentation
Css presentationCss presentation
Css presentation
 
Client side & Server side Scripting
Client side & Server side Scripting Client side & Server side Scripting
Client side & Server side Scripting
 
Software testing & Quality Assurance
Software testing & Quality Assurance Software testing & Quality Assurance
Software testing & Quality Assurance
 
Shadows Effects in CSS
Shadows Effects in CSSShadows Effects in CSS
Shadows Effects in CSS
 
Bs Typography
Bs TypographyBs Typography
Bs Typography
 
Bootstrap grids
Bootstrap gridsBootstrap grids
Bootstrap grids
 
Html formatting
Html formattingHtml formatting
Html formatting
 
Css position
Css positionCss position
Css position
 
Css Display Property
Css Display PropertyCss Display Property
Css Display Property
 
Html media
Html mediaHtml media
Html media
 
Css floats
Css floatsCss floats
Css floats
 
Css pseudo-classes
Css pseudo-classesCss pseudo-classes
Css pseudo-classes
 
Wordpress installation
Wordpress installationWordpress installation
Wordpress installation
 
Html tags or elements
Html tags or elementsHtml tags or elements
Html tags or elements
 
HTML Block and Inline Elements
HTML Block and Inline ElementsHTML Block and Inline Elements
HTML Block and Inline Elements
 

Recently uploaded

Book Formatting: Quality Control Checks for Designers
Book Formatting: Quality Control Checks for DesignersBook Formatting: Quality Control Checks for Designers
Book Formatting: Quality Control Checks for Designers
Confidence Ago
 
一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理
一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理
一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理
smpc3nvg
 
原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样
原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样
原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样
gpffo76j
 
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
h7j5io0
 
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
7sd8fier
 
Storytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design ProcessStorytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
 
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Mansi Shah
 
Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.
Techno Merch
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
cy0krjxt
 
Virtual Tour Application Powerpoint for museum of edinburgh
Virtual Tour Application Powerpoint for museum of edinburghVirtual Tour Application Powerpoint for museum of edinburgh
Virtual Tour Application Powerpoint for museum of edinburgh
millarj46
 
RTUYUIJKLDSADAGHBDJNKSMAL,D
RTUYUIJKLDSADAGHBDJNKSMAL,DRTUYUIJKLDSADAGHBDJNKSMAL,D
RTUYUIJKLDSADAGHBDJNKSMAL,D
cy0krjxt
 
Portfolio.pdf
Portfolio.pdfPortfolio.pdf
Portfolio.pdf
garcese
 
一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理
一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理
一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理
h7j5io0
 
PORTFOLIO FABIANA VILLANI ARCHITECTURE.pdf
PORTFOLIO FABIANA VILLANI ARCHITECTURE.pdfPORTFOLIO FABIANA VILLANI ARCHITECTURE.pdf
PORTFOLIO FABIANA VILLANI ARCHITECTURE.pdf
fabianavillanib
 
Can AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI preludeCan AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI prelude
Alan Dix
 
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANEEASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
Febless Hernane
 
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
9a93xvy
 
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdfSECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
eloprejohn333
 
Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...
Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...
Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...
ameli25062005
 
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
asuzyq
 

Recently uploaded (20)

Book Formatting: Quality Control Checks for Designers
Book Formatting: Quality Control Checks for DesignersBook Formatting: Quality Control Checks for Designers
Book Formatting: Quality Control Checks for Designers
 
一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理
一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理
一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理
 
原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样
原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样
原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样
 
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
 
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
 
Storytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design ProcessStorytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design Process
 
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
 
Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
 
Virtual Tour Application Powerpoint for museum of edinburgh
Virtual Tour Application Powerpoint for museum of edinburghVirtual Tour Application Powerpoint for museum of edinburgh
Virtual Tour Application Powerpoint for museum of edinburgh
 
RTUYUIJKLDSADAGHBDJNKSMAL,D
RTUYUIJKLDSADAGHBDJNKSMAL,DRTUYUIJKLDSADAGHBDJNKSMAL,D
RTUYUIJKLDSADAGHBDJNKSMAL,D
 
Portfolio.pdf
Portfolio.pdfPortfolio.pdf
Portfolio.pdf
 
一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理
一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理
一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理
 
PORTFOLIO FABIANA VILLANI ARCHITECTURE.pdf
PORTFOLIO FABIANA VILLANI ARCHITECTURE.pdfPORTFOLIO FABIANA VILLANI ARCHITECTURE.pdf
PORTFOLIO FABIANA VILLANI ARCHITECTURE.pdf
 
Can AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI preludeCan AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI prelude
 
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANEEASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
 
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
 
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdfSECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
 
Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...
Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...
Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...
 
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
 

Css box-model

  • 1. CSS- Cascading Style Sheet CSS Box Model
  • 2. CSS Box Model • All HTML elements can be considered as boxes. In CSS, the term "box model" is used when talking about design and layout. • The CSS box model is essentially a box that wraps around every HTML element. It consists of: margins, borders, padding, and the actual content. Call US: +91-9915337448 Email Us: info@webtechlearning.com
  • 3. CSS Box Model The image below illustrates the box model: Call US: +91-9915337448 Email Us: info@webtechlearning.com CONTENT PADDING MARGIN
  • 4. Explanation of the different parts: • Content - The content of the box, where text and images appear • Padding - Clears an area around the content. The padding is transparent • Border - A border that goes around the padding and content • Margin - Clears an area outside the border. The margin is transparent Call US: +91-9915337448 Email Us: info@webtechlearning.com
  • 5. Explanation of the different parts: • The box model allows us to add a border around elements, and to define space between elements. Call US: +91-9915337448 Email Us: info@webtechlearning.com div { width: 300px; padding: 25px; border: 25px solid navy; margin: 25px; }
  • 6. Width and Height of an Element • In order to set the width and height of an element correctly in all browsers, you need to know how the box model works. • Important: When you set the width and height properties of an element with CSS, you just set the width and height of the content area. To calculate the full size of an element, you must also add padding, borders and margins. Call US: +91-9915337448 Email Us: info@webtechlearning.com
  • 7. Maths 320px (width) + 20px (left + right padding) + 10px (left + right border) + 0px (left + right margin) = 350px Call US: +91-9915337448 Email Us: info@webtechlearning.com div { width: 320px; padding: 10px; border: 5px solid gray; margin: 0; }
  • 8. MATHS • The total width of an element should be calculated like this: • Total element width = width + left padding + right padding + left border + right border + left margin + right margin. • The total height of an element should be calculated like this: • Total element height = height + top padding + bottom padding + top border + bottom border + top margin + bottom margin Call US: +91-9915337448 Email Us: info@webtechlearning.com