SlideShare a Scribd company logo
The Box ModelColin Gourlay & Kevin Vanderbeken
Today:The Box ModelContainer ElementsOther Text Features
introduction
an aside on tables...
the CSS layout modela.k.a.the box model
1 07-the box-model
margin
outline
border
padding
contentHEGHTWIDTH
more detail + code examples
margin
margin-top: 3px;margin-right: 5px;margin-bottom: 7px;margin-left: 2px;...or...margin: 3px 5px 7px 2px;
outline
nonedotteddashedsoliddoublegrooveridgeinsetoutsetoutline-color: #999999;outline-style: dotted;outline-width: 5px;...or...outline: #999999 dotted 5px;
width & height
width: 200px;height: 120px;
border
nonedotteddashedsoliddoublegrooveridgeinsetoutsetborder-color: #00FF00;border-style: dotted;border-width: 5px;...or...border: 5px solid #00FF00;...but wait, there’s more!...
border-top-width: 2px;border-right-width: 5px;border-bottom-width: 2px;border-left-width: 5px;...and...border-top: 2px solid #00FF00;
padding
padding-top: 3px;padding-right: 5px;padding-bottom: 7px;padding-left: 2px;...or...padding: 3px 5px 7px 2px;
recap
margin
outline
border
padding
contentHEGHTWIDTH
text featuresworth mentioning
line height
line-height: 24px;
text alignment
text-align: left;text-align: right;text-align: center;text-align: justify;
next week...
More on The Box ModelTMDifferent boxes: block & inlineBox interaction: floats & positioning
Ad

More Related Content

Similar to 1 07-the box-model (20)

Intro to HTML & CSS
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSS
Colin Loretz
 
CSS Box Model
CSS Box ModelCSS Box Model
CSS Box Model
Gerson Abesamis
 
Lab#7 CSS Box Model
Lab#7 CSS Box ModelLab#7 CSS Box Model
Lab#7 CSS Box Model
Yaowaluck Promdee
 
CSS and Layout
CSS and LayoutCSS and Layout
CSS and Layout
Jussi Pohjolainen
 
Harendra Singh,BCA Third Year
Harendra Singh,BCA Third YearHarendra Singh,BCA Third Year
Harendra Singh,BCA Third Year
dezyneecole
 
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsMobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Kaelig Deloumeau-Prigent
 
UI 101
UI 101UI 101
UI 101
Rubikal
 
Lecture 3: HTML & CSS
Lecture 3: HTML & CSSLecture 3: HTML & CSS
Lecture 3: HTML & CSS
Manolis Vavalis
 
The Future of CSS
The Future of CSSThe Future of CSS
The Future of CSS
elliando dias
 
CSSO – compress CSS (english version)
CSSO – compress CSS (english version)CSSO – compress CSS (english version)
CSSO – compress CSS (english version)
Roman Dvornov
 
SASS In The Real World
SASS In The Real WorldSASS In The Real World
SASS In The Real World
fesuffolk
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
Wynn Netherland
 
Gmail tutorials
Gmail tutorialsGmail tutorials
Gmail tutorials
albert ndicho
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
Rob Davarnia
 
HTML5 and CSS3 Refresher
HTML5 and CSS3 RefresherHTML5 and CSS3 Refresher
HTML5 and CSS3 Refresher
Ivano Malavolta
 
Css for nondesigners
Css for nondesignersCss for nondesigners
Css for nondesigners
Ignacio Coloma
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)
elliando dias
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
 
Intro to HTML & CSS
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSS
Colin Loretz
 
Harendra Singh,BCA Third Year
Harendra Singh,BCA Third YearHarendra Singh,BCA Third Year
Harendra Singh,BCA Third Year
dezyneecole
 
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsMobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Kaelig Deloumeau-Prigent
 
CSSO – compress CSS (english version)
CSSO – compress CSS (english version)CSSO – compress CSS (english version)
CSSO – compress CSS (english version)
Roman Dvornov
 
SASS In The Real World
SASS In The Real WorldSASS In The Real World
SASS In The Real World
fesuffolk
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
Wynn Netherland
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
Rob Davarnia
 
HTML5 and CSS3 Refresher
HTML5 and CSS3 RefresherHTML5 and CSS3 Refresher
HTML5 and CSS3 Refresher
Ivano Malavolta
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)
elliando dias
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
 

More from apnwebdev (8)

1 05-css for-text_and_backgrounds
1 05-css for-text_and_backgrounds1 05-css for-text_and_backgrounds
1 05-css for-text_and_backgrounds
apnwebdev
 
1 04-html elements
1 04-html elements1 04-html elements
1 04-html elements
apnwebdev
 
1-07: The Box Model
1-07: The Box Model1-07: The Box Model
1-07: The Box Model
apnwebdev
 
1-06: More HTML Elements
1-06: More HTML Elements1-06: More HTML Elements
1-06: More HTML Elements
apnwebdev
 
1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgrounds1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgrounds
apnwebdev
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
apnwebdev
 
1-02: HTML Markup Introduction
1-02: HTML Markup Introduction1-02: HTML Markup Introduction
1-02: HTML Markup Introduction
apnwebdev
 
1-01: Introduction To Web Development
1-01: Introduction To  Web  Development1-01: Introduction To  Web  Development
1-01: Introduction To Web Development
apnwebdev
 
1 05-css for-text_and_backgrounds
1 05-css for-text_and_backgrounds1 05-css for-text_and_backgrounds
1 05-css for-text_and_backgrounds
apnwebdev
 
1 04-html elements
1 04-html elements1 04-html elements
1 04-html elements
apnwebdev
 
1-07: The Box Model
1-07: The Box Model1-07: The Box Model
1-07: The Box Model
apnwebdev
 
1-06: More HTML Elements
1-06: More HTML Elements1-06: More HTML Elements
1-06: More HTML Elements
apnwebdev
 
1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgrounds1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgrounds
apnwebdev
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
apnwebdev
 
1-02: HTML Markup Introduction
1-02: HTML Markup Introduction1-02: HTML Markup Introduction
1-02: HTML Markup Introduction
apnwebdev
 
1-01: Introduction To Web Development
1-01: Introduction To  Web  Development1-01: Introduction To  Web  Development
1-01: Introduction To Web Development
apnwebdev
 
Ad

Recently uploaded (20)

Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
machines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdfmachines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdf
AmirStern2
 
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Cyntexa
 
Build With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdfBuild With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdf
Google Developer Group - Harare
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Bepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firmBepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firm
Benard76
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
AsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API DesignAsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API Design
leonid54
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptxTop 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
mkubeusa
 
How to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabberHow to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabber
eGrabber
 
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
machines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdfmachines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdf
AmirStern2
 
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Cyntexa
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Bepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firmBepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firm
Benard76
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
AsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API DesignAsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API Design
leonid54
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptxTop 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
mkubeusa
 
How to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabberHow to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabber
eGrabber
 
Ad

1 07-the box-model

Editor's Notes

  • #4: We've shown you many types of elements, and the subsequent common css properties that change their appearance. Now it's time to learn how they play together - and not just elements of the same type.The document is a crowded place, but through our control and placement, our careful styling, and hopefully a bit of CORRECT rendering display by the browser used - we get a well designed display.How can we control the placement of all these stacked up elements? To do this, we alter some of the properties of css that control how elements interact.
  • #5: With our last lecture, we've been able to show that tables were logically ordered blocks of code that get organised and drawn little boxes (cells) in an ordered grid. The rules of what make a table organised and displayed in the way it is, is set out by the standards and the browsers that have been designed to use them. We can't override everything in the way something is drawn (because for example, tables are meant to be tables after all) but the more generic an element is, the more pliable it becomes. 
  • #6: The best way to describe the layout model is with it's common name - the box model. It helps us to visualize what's going on when the document is shown in the browser.Lets illustrate this with an example...
  • #7:  Lets think of it as a <p> element given the exploded view so we can see it's box model in detail. Lets paraphrase Shrek for a moment:"Elements are like onions, they have layers.“Lets imagine this 'block' element's top and work our way inward, in layers:
  • #8: Margin [invisible] (pushes other elements away; personal space for elements)
  • #9: Outline [decorating line] (shares the same space as the margin if you set both)
  • #10: Border [decorating line] (having it increases the apparent size of the element) 
  • #11: Padding [invisible space] (also increases apparent size; fills more internal space up!)
  • #12: And the the content!This includes: ----- Height (and Width) ------
  • #13: This outside to inside layering happens for top, right, bottom, and left of a block element. Lets look at each in more detail. 
  • #14: The invisible margin area is like personal space for elements. It keeps other elements pushed a certain amount away from it, or keeps itself away from the edges of immovable boundaries like the browser window size or the element's fixed width and height parent elements. If another element is jostling with this margined element, but it also has a margin... that margin will overlap. Whoever has the largest margin value of those interacting elements, will determine how far they are from each other.
  • #16: The outline of an element is quite self explanatory in purpose. You're adding an outline of a certain width, colour and density to the bounding dimensions of the element so it kind of looks like a box. Again, the amount of outline is drawn out and away from the width and height boundary.
  • #17: The outline-style property can be quite decorative actually; with dotted, dashed, solid, double lined, 3d looking grooves, 3d looking ridges, the 3d look of being inset into the page, and the 3d look of outset from the page - all available.Outline is still tricky though, as it shares the space that the Margin uses. If you have a 4px Outline, and a 4px Margin, the final result is a margin overlapping the outline, but that's not going to change the appearance as margin's are invisible space, and outlines are definitely visible. If you have two elements next to each other, the outline of either one will not hesitate to bleed into the space of the other element. The outline is like air in the fact that other elements pass right through it and overlap it regardless if it's there or not. 
  • #18: This might seem like it's the easiest to tackle because ultimately; this block element is being treated as, a simple rectangle!!By expanding and contracting in two dimensions, we can have the element occupy a space of the document's final rendered view. But, that said... if we add other things like border and padding to the inside of it, we're actually ADDING to the element's final visual dimensions because we're 'filling' it with more space - hence expanding it's boundaries. It's like a balloon in that way.The properties for width and height are:
  • #20: A lot like the outline, a border is going to let us show a line with the bounds of the element. This time though, the border takes up space inside the bounding dimensions of the width and height. The width of the border actually adds to the size to the final width and height of the element when everything is presented. This happens on the same principle as a balloon - we stretch the balloon to it's width and height, but if we add more contents to it's inside, it's only option is to grow to accommodate that as well. When you're trying to make a box on the screen that contains something, and you want a border, you'll need to deduct those amounts from the final size you're aiming for. It uses it's own space and doesn't share! Eg, i want it to appear as 300px wide... so with a border of 5px set, my value for width should only be 295px. Borders also push content inward, not allowing it to overlap the border.Border-style's have exactly the same decorative properties of outlines; with dotted, dashed, solid, double lined, 3d looking grooves, 3d looking ridges, the 3d look of being inset into the page, and the 3d look of outset from the page.
  • #23: adding is that little bit of extra cushion we put on an element to separate it's content from the border or outline. It's extra space, on the inside of the element's bounding dimensions, and just like border, adds to the size of the final element if you didn't think about it before specifying your height and width. If we add more padding to the element's inside, it's only option is to grow to accommodate that as well.
  • #25: Lets recap our layers now with this new found knowledge:
  • #26: Margin [invisible] (pushes other elements away; personal space for elements)
  • #27: Outline [decorating line] (shares the same space as the margin if you set both)
  • #28: Border [decorating line] (having it increases the apparent size of the element) 
  • #29: Padding [invisible space] (also increases apparent size; fills more internal space up!)
  • #30: And the the content!This includes: ----- Height (and Width) ------
  • #31: Once you get to the core of content through all the box model layers, there are a few other properties which come into play in addition to our other known properties for text content etc. 
  • #32: This is very basically; a certain amount of height, vertically centered over the middle of the text. A large line-height on small text, might have the effect of creating a gap below and above the text evenly between lines. How is this different from padding the text element? Well line-height is not applied to the box of the element, it's on the content - and because of that it affects all lines inside this element of text instead of the sides of the block of text.
  • #33: For example, setting a line height on a paragraph (<p>...</p>) element will increase the space between each line of text as it flows from left to right. It's essentially the word-processor equivalent to line spacing. These height changes can space or position the text vertically in different places relative to the size of the text, and the design of the font.
  • #34: This one is simple - it's horizontal alignment of text content inside it's element. left, centered, or right. There's also justification (and it works okay in decent browsers).
  翻译: