The fundamentals
of the browser
rendering - part 1
By Barak Drechsler
How css feels like...
How css
should feel...
Web
rendering
flow
1. Process HTML markup and build the DOM
tree.
2. Process CSS markup and build the CSSOM
tree.
3. Combine the DOM and CSSOM into a render
tree.
4. Run layout on the render tree to compute
geometry of each node.
5. Paint the individual nodes to the screen.
Fundamentals of Browser Rendering Css Overview PT 1
The web
building
blocks are
boxes
The CSS box model is the foundation of layout
on the Web — each element is represented as a
rectangular box, with the box's content,
padding, border, and margin built up around
one another like the layers of an onion.
As a browser renders a web page layout, it
works out what styles are applied to the content
of each box, how big the surrounding onion
layers are, and where the boxes sit in relation to
one another.
The Box Model
(content-box)
The Box Model
(border-box)
Play Time - Box Models
https://plnkr.co/edit/XNYbkiuXiS
H49haIhdCv?p=preview
Quick recap for the box
properties
Overflow: defaults to visible, requires the
box to have explicit height, or percentage to
be calculated by parent element height.
Height: isn’t inherited! Any div in the way
can interfere with it children heights
Border, padding, margin, are
straightforward...
Play Time - Height & Overflow
https://plnkr.co/edit/23kJgu8u1A
ssnLlHVt27?p=preview
Boxes types...
Block
Inline
Inline-block
none
(table, flex, grid)
Block
Block level elements do not sit inline, but break past them. If no width is set, will expand naturally
to fill its parent container.
Can have margins and/or padding.
If no height is set, will expand naturally to fit its child elements (assuming they are not floated or
positioned). So, for a block element, it’s not necessary to give it a set width or to give it a width of
100%.
Ignores the vertical-align property.
Inline
Default value for elements. Think of elements like span, b or em
Will ignore top and bottom margin/padding settings, but will apply left and right margin/padding.
Only moves horizontally, not vertically.
Is subject to vertical-align property.
Will ignore width and height properties.
If floated left or right, will automatically become a block-level element, subject to all block
characteristics.
Inline Block
Very similar to inline to its parents in that it will set inline with the natural flow of text.
Very similar to block to its children in that it can have a width and height and its content can
move vertically.
Think of a display:block element that has been rendered (or converted to an image) and then
placed in the document inline
Margin and paddings work properly.
Width and height will be respected.
Play Time - inline, block, inline-
block
https://codepen.io/barakdr/pen/
GNrBRg
Summary
1. We discussed the browser rendering flow DOM + CSSOM => Render Tree => Layout =>
paint.
2. Each element is box.
3. It height is defined by it box-model, either (content-box or border-box).
4. We have a different types of boxes which affect element behaviour (inline, block, inline-
block, flex, none)
The road ahead...
We now have to see, how can we affect how elements are being put together.
The ways to manipulate browser layout:
Floats
Positioning - next session
CSS tables
Flexbox
Grid
Float
The float CSS property specifies that an element should be taken from the normal flow and
placed along the left or right side of its container, where text and inline elements will wrap
around it.
A floating element is one where the computed value of float is not none.
(MDN)
Play Time - floats
https://plnkr.co/edit/Bz4hS2E9e
mkbr3fvts16?p=preview
Float - summary
1. When an element is floated it is taken out of the normal flow of the document. It is shifted
to the left or right until it touches the edge of its containing box or another floated element.
2. Float elements must be given explicit width, otherwise unexpected behavior could occur.
3. Non-positioned, non-floated, block-level elements act as if the floated element is not there.
4. To make parent of floats take it height, we must clear the floats, a trick could be adding
overflow: auto.
5. Bootstrap grid system is float based.
Questions?

More Related Content

PPTX
Fundamentals of Browser Rendering Css Overview PT 2
PPTX
10thingsin ku
PDF
10 อย่างที่นิสิตม.เกษตรต้องรู้
ODP
Continuous Delivery with Spinnaker.io
PPTX
5710602337เรื่องน่ารู้มอเกษตร
PPTX
อัญญรัตน์ ม่วงประเสริฐ
PPTX
T shirt for you
DOCX
한미약품 36시간 지속형 발기부전치료제『33ss.ow.to』구구정 정품직구々구구정 정품팝니다「구구정 정품구입합니다∶구구정 병원가격∈
Fundamentals of Browser Rendering Css Overview PT 2
10thingsin ku
10 อย่างที่นิสิตม.เกษตรต้องรู้
Continuous Delivery with Spinnaker.io
5710602337เรื่องน่ารู้มอเกษตร
อัญญรัตน์ ม่วงประเสริฐ
T shirt for you
한미약품 36시간 지속형 발기부전치료제『33ss.ow.to』구구정 정품직구々구구정 정품팝니다「구구정 정품구입합니다∶구구정 병원가격∈

Similar to Fundamentals of Browser Rendering Css Overview PT 1 (20)

PDF
Web Design & Development - Session 3
PPT
Css layouts-continued
PDF
Introduction to Frontend Development - Session 2 - CSS Fundamentals
PDF
Inline, Block and Positioning in CSS
PPTX
Lecture-8.pptx
PDF
Css display
PDF
Web Layout
PDF
CSS3 Refresher
PDF
CSS Foundations, pt 2
PDF
Intro to CSS
PPTX
Designing for the web - 101
PPTX
Module 5-Positioning and Navigation(Chapters 5 & 6).pptx
PPTX
CSS tutorial chapter 3
PDF
Dangerous CSS
PPTX
Lecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
PPTX
CSS3 notes
PPTX
Castro Chapter 11
PPTX
css3.pptx
PPT
gdg_workshop 4 on web development HTML & CSS
KEY
Css Essential
Web Design & Development - Session 3
Css layouts-continued
Introduction to Frontend Development - Session 2 - CSS Fundamentals
Inline, Block and Positioning in CSS
Lecture-8.pptx
Css display
Web Layout
CSS3 Refresher
CSS Foundations, pt 2
Intro to CSS
Designing for the web - 101
Module 5-Positioning and Navigation(Chapters 5 & 6).pptx
CSS tutorial chapter 3
Dangerous CSS
Lecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
CSS3 notes
Castro Chapter 11
css3.pptx
gdg_workshop 4 on web development HTML & CSS
Css Essential
Ad

More from Barak Drechsler (7)

PPTX
Stay lazy, use lerna
PPTX
Atomic javascript
PPTX
Room service (worker) please!
PPTX
From MVC to Component Based Architecture
PPTX
Js: master prototypes
PPTX
Understanding the flex layout
PPTX
Javascript: master this
Stay lazy, use lerna
Atomic javascript
Room service (worker) please!
From MVC to Component Based Architecture
Js: master prototypes
Understanding the flex layout
Javascript: master this
Ad

Recently uploaded (20)

DOCX
Memecoinist Update: Best Meme Coins 2025, Trump Meme Coin Predictions, and th...
PDF
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
PDF
Buy Cash App Verified Accounts Instantly – Secure Crypto Deal.pdf
PDF
The Evolution of Traditional to New Media .pdf
PPSX
AI AppSec Threats and Defenses 20250822.ppsx
PDF
KEY COB2 UNIT 1: The Business of businessĐH KInh tế TP.HCM
PDF
healthwealthtech4all-blogspot-com-2025-08-top-5-tech-innovations-that-will-ht...
PPTX
The-Importance-of-School-Sanitation.pptx
PDF
BIOCHEM CH2 OVERVIEW OF MICROBIOLOGY.pdf
PPTX
curriculumandpedagogyinearlychildhoodcurriculum-171021103104 - Copy.pptx
PPTX
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
PPTX
Top Website Bugs That Hurt User Experience – And How Expert Web Design Fixes
PPTX
Cyber Hygine IN organizations in MSME or
PDF
simpleintnettestmetiaerl for the simple testint
PPTX
COPD_Management_Exacerbation_Detailed_Placeholders.pptx
PPTX
Tìm hiểu về dịch vụ FTTH - Fiber Optic Access Node
PPTX
ECO SAFE AI - SUSTAINABLE SAFE AND HOME HUB
PDF
Virtual Guard Technology Provider_ Remote Security Service Solutions.pdf
PDF
Containerization lab dddddddddddddddmanual.pdf
PPTX
在线订购名古屋艺术大学毕业证, buy NUA diploma学历认证失败怎么办
Memecoinist Update: Best Meme Coins 2025, Trump Meme Coin Predictions, and th...
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
Buy Cash App Verified Accounts Instantly – Secure Crypto Deal.pdf
The Evolution of Traditional to New Media .pdf
AI AppSec Threats and Defenses 20250822.ppsx
KEY COB2 UNIT 1: The Business of businessĐH KInh tế TP.HCM
healthwealthtech4all-blogspot-com-2025-08-top-5-tech-innovations-that-will-ht...
The-Importance-of-School-Sanitation.pptx
BIOCHEM CH2 OVERVIEW OF MICROBIOLOGY.pdf
curriculumandpedagogyinearlychildhoodcurriculum-171021103104 - Copy.pptx
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
Top Website Bugs That Hurt User Experience – And How Expert Web Design Fixes
Cyber Hygine IN organizations in MSME or
simpleintnettestmetiaerl for the simple testint
COPD_Management_Exacerbation_Detailed_Placeholders.pptx
Tìm hiểu về dịch vụ FTTH - Fiber Optic Access Node
ECO SAFE AI - SUSTAINABLE SAFE AND HOME HUB
Virtual Guard Technology Provider_ Remote Security Service Solutions.pdf
Containerization lab dddddddddddddddmanual.pdf
在线订购名古屋艺术大学毕业证, buy NUA diploma学历认证失败怎么办

Fundamentals of Browser Rendering Css Overview PT 1

  • 1. The fundamentals of the browser rendering - part 1 By Barak Drechsler
  • 2. How css feels like...
  • 4. Web rendering flow 1. Process HTML markup and build the DOM tree. 2. Process CSS markup and build the CSSOM tree. 3. Combine the DOM and CSSOM into a render tree. 4. Run layout on the render tree to compute geometry of each node. 5. Paint the individual nodes to the screen.
  • 6. The web building blocks are boxes The CSS box model is the foundation of layout on the Web — each element is represented as a rectangular box, with the box's content, padding, border, and margin built up around one another like the layers of an onion. As a browser renders a web page layout, it works out what styles are applied to the content of each box, how big the surrounding onion layers are, and where the boxes sit in relation to one another.
  • 9. Play Time - Box Models https://plnkr.co/edit/XNYbkiuXiS H49haIhdCv?p=preview
  • 10. Quick recap for the box properties Overflow: defaults to visible, requires the box to have explicit height, or percentage to be calculated by parent element height. Height: isn’t inherited! Any div in the way can interfere with it children heights Border, padding, margin, are straightforward...
  • 11. Play Time - Height & Overflow https://plnkr.co/edit/23kJgu8u1A ssnLlHVt27?p=preview
  • 13. Block Block level elements do not sit inline, but break past them. If no width is set, will expand naturally to fill its parent container. Can have margins and/or padding. If no height is set, will expand naturally to fit its child elements (assuming they are not floated or positioned). So, for a block element, it’s not necessary to give it a set width or to give it a width of 100%. Ignores the vertical-align property.
  • 14. Inline Default value for elements. Think of elements like span, b or em Will ignore top and bottom margin/padding settings, but will apply left and right margin/padding. Only moves horizontally, not vertically. Is subject to vertical-align property. Will ignore width and height properties. If floated left or right, will automatically become a block-level element, subject to all block characteristics.
  • 15. Inline Block Very similar to inline to its parents in that it will set inline with the natural flow of text. Very similar to block to its children in that it can have a width and height and its content can move vertically. Think of a display:block element that has been rendered (or converted to an image) and then placed in the document inline Margin and paddings work properly. Width and height will be respected.
  • 16. Play Time - inline, block, inline- block https://codepen.io/barakdr/pen/ GNrBRg
  • 17. Summary 1. We discussed the browser rendering flow DOM + CSSOM => Render Tree => Layout => paint. 2. Each element is box. 3. It height is defined by it box-model, either (content-box or border-box). 4. We have a different types of boxes which affect element behaviour (inline, block, inline- block, flex, none)
  • 18. The road ahead... We now have to see, how can we affect how elements are being put together. The ways to manipulate browser layout: Floats Positioning - next session CSS tables Flexbox Grid
  • 19. Float The float CSS property specifies that an element should be taken from the normal flow and placed along the left or right side of its container, where text and inline elements will wrap around it. A floating element is one where the computed value of float is not none. (MDN)
  • 20. Play Time - floats https://plnkr.co/edit/Bz4hS2E9e mkbr3fvts16?p=preview
  • 21. Float - summary 1. When an element is floated it is taken out of the normal flow of the document. It is shifted to the left or right until it touches the edge of its containing box or another floated element. 2. Float elements must be given explicit width, otherwise unexpected behavior could occur. 3. Non-positioned, non-floated, block-level elements act as if the floated element is not there. 4. To make parent of floats take it height, we must clear the floats, a trick could be adding overflow: auto. 5. Bootstrap grid system is float based.

Editor's Notes

  • #5: https://developers.google.com/web/fundamentals/performance/critical-rendering-path/render-tree-construction
  • #6: https://developers.google.com/web/fundamentals/performance/critical-rendering-path/render-tree-construction
  • #14: https://github.com/vasanthk/css-refresher-notes
  • #15: https://github.com/vasanthk/css-refresher-notes
  • #16: https://github.com/vasanthk/css-refresher-notes
  • #18: https://github.com/vasanthk/css-refresher-notes
  • #19: https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Introduction
  • #20: https://developer.mozilla.org/en-US/docs/Web/CSS/float
  • #22: https://developer.mozilla.org/en-US/docs/Web/CSS/float