SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Building and Marketing Websites
Color
• Computers create the colors you see on a
monitor by combining three colors: red,
green, and blue
• You can create a recipe for a color by telling
the computer how much of the three to mix in
Color Summary
Box Model
Every element in a document, both
block-level and inline, generates a
rectangular element box
Content Dimensions
• Width and height properties to specify the
width and height of the content area of the
element
• Can specify the width and height only of
block-level elements and non-text inline
elements such as images
Specifying Height
• Less common to specify the height of
elements
• Overflow property lets you specify what to do
with text that doesn’t fit
<style type=“text/css”>
p {
height: 100px;
overflow: auto;
}
</style>
Overflow Values
Padding
• Space between the content area and the
border
Specifying Padding
• padding-top, padding-right, padding-bottom,
padding-left
<style type=“text/css”>
p {
padding-top: 5em;
padding-right: 2em;
padding-bottom: 4em;
padding-left: 1em;
}
</style>
<style type=“text/css”>
p {
padding-top: 5em;
padding-right: 2em;
padding-bottom: 4em;
padding-left: 1em;
}
</style>
Padding Shorthand
• 1 value : padding: 10px;
– Applied to all sides.
• 2 values : padding: 10px 6px;
– First is top and bottom;
– Second is left and right.
• 3 values : padding: 10px 6px 4px;
– First is top;
– Second is left and right;
– Third is bottom.
• 4 values : padding: 10px 6px 4px 10px;
– Applied clockwise to top, right, bottom, and left edges
consecutively
– (TRBL).
Border
• Line that surrounds the element and its
padding.
• Optional.
Specifying Border Style
• Property : border-style
– Values: Dotted, dashed, solid, double, groove,
ridge, inset, outset
• More properties: border-top-style, border-
right-style, border-bottom-style, border-left-
style
p {
border-top-style: solid;
border-right-style: dashed;
border-bottom-style: double;
border-left-style: dotted;
width: 300px;
height: 100px;
}
Specifying Border Width
• Property: border-width
– Values: length units, thin, medium, thick
• More properties: border-top-width, border-
right-width, border-bottom-width, border-
left-width
Specifying Border Color
• Property: border-color
• More Properties: border-top-color, border-
right-color, border-bottom-color, border-left-
color
Specifying Border
• You can provide style, width, and color values
in one declaration
p {
border: 1px dashed #F26521;
}
Specifying Border
• Can also use: border-top, border-right,
border-bottom, border-left
• Values for properties may include style, width,
and color values in any order.
• If the border style value is omitted, no border
will show.
Margin
• Space added on the outside of the border
• Optional.
Specifying Margin
• Similar to padding
• margin-top, margin-right, margin-bottom,
margin-left
• Same short hands as padding apply
Margins
• The top and bottom margins of neighboring
elements collapse.
• Instead of accumulating, adjacent margins
overlap, and only the largest value will be
used
Margins
• Only horizontal margins are rendered on
inline text elements
• For non-text inline elements, margins
rendered on all sides.

Weitere ähnliche Inhalte

Andere mochten auch

Searching over the past, present and future
Searching over the past, present and futureSearching over the past, present and future
Searching over the past, present and futureRoi Blanco
 
Tmh5 rahasia-kitab-tujuh
Tmh5 rahasia-kitab-tujuhTmh5 rahasia-kitab-tujuh
Tmh5 rahasia-kitab-tujuhRidwan Gucci
 
The Fuelwood Market Chain of Kinshasa: Socio-economic and sustainability outc...
The Fuelwood Market Chain of Kinshasa: Socio-economic and sustainability outc...The Fuelwood Market Chain of Kinshasa: Socio-economic and sustainability outc...
The Fuelwood Market Chain of Kinshasa: Socio-economic and sustainability outc...Verina Ingram
 
HRM CityMatters Survey Results - November 2013
HRM CityMatters Survey Results - November 2013 HRM CityMatters Survey Results - November 2013
HRM CityMatters Survey Results - November 2013 Halifax Partnership
 
Workshops Red ArgenTIna IT 2015 - Propuesta de Sponsoreo
Workshops Red ArgenTIna IT 2015 - Propuesta de SponsoreoWorkshops Red ArgenTIna IT 2015 - Propuesta de Sponsoreo
Workshops Red ArgenTIna IT 2015 - Propuesta de SponsoreoCESSI ArgenTIna
 
Caching Search Engine Results over Incremental Indices
Caching Search Engine Results over Incremental IndicesCaching Search Engine Results over Incremental Indices
Caching Search Engine Results over Incremental IndicesRoi Blanco
 
Destination pluto
Destination plutoDestination pluto
Destination plutoLisa Baird
 
Halifax’s Finance and Insurance Industry: Our Opportunity
Halifax’s Finance and Insurance Industry: Our OpportunityHalifax’s Finance and Insurance Industry: Our Opportunity
Halifax’s Finance and Insurance Industry: Our OpportunityHalifax Partnership
 
Responsible Disclosure - For Dutch ISACA chapter
Responsible Disclosure - For Dutch ISACA chapterResponsible Disclosure - For Dutch ISACA chapter
Responsible Disclosure - For Dutch ISACA chapterFrank Breedijk
 
AGREATERHalifax - the 2011-16 Economic Strategy for Halifax, Nova Scotia
AGREATERHalifax - the 2011-16 Economic Strategy for Halifax, Nova Scotia AGREATERHalifax - the 2011-16 Economic Strategy for Halifax, Nova Scotia
AGREATERHalifax - the 2011-16 Economic Strategy for Halifax, Nova Scotia Halifax Partnership
 
The ancient middle east mesopotamian literature2
The ancient middle east  mesopotamian literature2The ancient middle east  mesopotamian literature2
The ancient middle east mesopotamian literature2sparky31522
 
Present simple vs. present continuous
Present simple vs. present continuousPresent simple vs. present continuous
Present simple vs. present continuousAlexandra Canal
 
Windows one - a platform that will merge Windows Phone, Windows RT and Window...
Windows one - a platform that will merge Windows Phone, Windows RT and Window...Windows one - a platform that will merge Windows Phone, Windows RT and Window...
Windows one - a platform that will merge Windows Phone, Windows RT and Window...Ankur Jain
 
Englishtestunit73 eso d-2
Englishtestunit73 eso d-2Englishtestunit73 eso d-2
Englishtestunit73 eso d-2Vicky
 

Andere mochten auch (18)

Searching over the past, present and future
Searching over the past, present and futureSearching over the past, present and future
Searching over the past, present and future
 
Tmh5 rahasia-kitab-tujuh
Tmh5 rahasia-kitab-tujuhTmh5 rahasia-kitab-tujuh
Tmh5 rahasia-kitab-tujuh
 
2014 Halifax Index Presentation
2014 Halifax Index Presentation2014 Halifax Index Presentation
2014 Halifax Index Presentation
 
The Fuelwood Market Chain of Kinshasa: Socio-economic and sustainability outc...
The Fuelwood Market Chain of Kinshasa: Socio-economic and sustainability outc...The Fuelwood Market Chain of Kinshasa: Socio-economic and sustainability outc...
The Fuelwood Market Chain of Kinshasa: Socio-economic and sustainability outc...
 
Mission mars
Mission mars Mission mars
Mission mars
 
HRM CityMatters Survey Results - November 2013
HRM CityMatters Survey Results - November 2013 HRM CityMatters Survey Results - November 2013
HRM CityMatters Survey Results - November 2013
 
Workshops Red ArgenTIna IT 2015 - Propuesta de Sponsoreo
Workshops Red ArgenTIna IT 2015 - Propuesta de SponsoreoWorkshops Red ArgenTIna IT 2015 - Propuesta de Sponsoreo
Workshops Red ArgenTIna IT 2015 - Propuesta de Sponsoreo
 
Caching Search Engine Results over Incremental Indices
Caching Search Engine Results over Incremental IndicesCaching Search Engine Results over Incremental Indices
Caching Search Engine Results over Incremental Indices
 
Destination pluto
Destination plutoDestination pluto
Destination pluto
 
Halifax’s Finance and Insurance Industry: Our Opportunity
Halifax’s Finance and Insurance Industry: Our OpportunityHalifax’s Finance and Insurance Industry: Our Opportunity
Halifax’s Finance and Insurance Industry: Our Opportunity
 
GREEN DIWALI
GREEN DIWALIGREEN DIWALI
GREEN DIWALI
 
Media evaluation
Media evaluationMedia evaluation
Media evaluation
 
Responsible Disclosure - For Dutch ISACA chapter
Responsible Disclosure - For Dutch ISACA chapterResponsible Disclosure - For Dutch ISACA chapter
Responsible Disclosure - For Dutch ISACA chapter
 
AGREATERHalifax - the 2011-16 Economic Strategy for Halifax, Nova Scotia
AGREATERHalifax - the 2011-16 Economic Strategy for Halifax, Nova Scotia AGREATERHalifax - the 2011-16 Economic Strategy for Halifax, Nova Scotia
AGREATERHalifax - the 2011-16 Economic Strategy for Halifax, Nova Scotia
 
The ancient middle east mesopotamian literature2
The ancient middle east  mesopotamian literature2The ancient middle east  mesopotamian literature2
The ancient middle east mesopotamian literature2
 
Present simple vs. present continuous
Present simple vs. present continuousPresent simple vs. present continuous
Present simple vs. present continuous
 
Windows one - a platform that will merge Windows Phone, Windows RT and Window...
Windows one - a platform that will merge Windows Phone, Windows RT and Window...Windows one - a platform that will merge Windows Phone, Windows RT and Window...
Windows one - a platform that will merge Windows Phone, Windows RT and Window...
 
Englishtestunit73 eso d-2
Englishtestunit73 eso d-2Englishtestunit73 eso d-2
Englishtestunit73 eso d-2
 

Ähnlich wie Pres (20)

Dimensions of elements.pdf
Dimensions of elements.pdfDimensions of elements.pdf
Dimensions of elements.pdf
 
CSS tutorial chapter 2
CSS tutorial chapter 2CSS tutorial chapter 2
CSS tutorial chapter 2
 
Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box Model
 
Css3
Css3Css3
Css3
 
Cascading style sheet part 2
Cascading style sheet   part 2Cascading style sheet   part 2
Cascading style sheet part 2
 
Introduction to CSS Borders - Lesson 4
Introduction to CSS Borders - Lesson 4Introduction to CSS Borders - Lesson 4
Introduction to CSS Borders - Lesson 4
 
Border
BorderBorder
Border
 
Css borders
Css bordersCss borders
Css borders
 
Unit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptxUnit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptx
 
Css summary
Css summaryCss summary
Css summary
 
Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3
 
Web Development - Lecture 6
Web Development - Lecture 6Web Development - Lecture 6
Web Development - Lecture 6
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
 
Css
CssCss
Css
 
css3.pptx
css3.pptxcss3.pptx
css3.pptx
 
Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)
 
Css2
Css2Css2
Css2
 
Css2
Css2Css2
Css2
 
Pemrograman Web 2 - CSS
Pemrograman Web 2 - CSSPemrograman Web 2 - CSS
Pemrograman Web 2 - CSS
 
Layouts
Layouts Layouts
Layouts
 

Mehr von Andrey L

Mehr von Andrey L (7)

Pres
PresPres
Pres
 
Pres
PresPres
Pres
 
Pres
PresPres
Pres
 
Pres
PresPres
Pres
 
Pres
PresPres
Pres
 
Pres
PresPres
Pres
 
Intro 1 sept_14_2010
Intro 1 sept_14_2010Intro 1 sept_14_2010
Intro 1 sept_14_2010
 

Kürzlich hochgeladen

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 

Kürzlich hochgeladen (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Pres

  • 2. Color • Computers create the colors you see on a monitor by combining three colors: red, green, and blue • You can create a recipe for a color by telling the computer how much of the three to mix in
  • 5. Every element in a document, both block-level and inline, generates a rectangular element box
  • 6.
  • 7. Content Dimensions • Width and height properties to specify the width and height of the content area of the element • Can specify the width and height only of block-level elements and non-text inline elements such as images
  • 8. Specifying Height • Less common to specify the height of elements • Overflow property lets you specify what to do with text that doesn’t fit
  • 9. <style type=“text/css”> p { height: 100px; overflow: auto; } </style>
  • 11. Padding • Space between the content area and the border
  • 12. Specifying Padding • padding-top, padding-right, padding-bottom, padding-left <style type=“text/css”> p { padding-top: 5em; padding-right: 2em; padding-bottom: 4em; padding-left: 1em; } </style>
  • 13. <style type=“text/css”> p { padding-top: 5em; padding-right: 2em; padding-bottom: 4em; padding-left: 1em; } </style>
  • 14. Padding Shorthand • 1 value : padding: 10px; – Applied to all sides. • 2 values : padding: 10px 6px; – First is top and bottom; – Second is left and right. • 3 values : padding: 10px 6px 4px; – First is top; – Second is left and right; – Third is bottom. • 4 values : padding: 10px 6px 4px 10px; – Applied clockwise to top, right, bottom, and left edges consecutively – (TRBL).
  • 15. Border • Line that surrounds the element and its padding. • Optional.
  • 16. Specifying Border Style • Property : border-style – Values: Dotted, dashed, solid, double, groove, ridge, inset, outset • More properties: border-top-style, border- right-style, border-bottom-style, border-left- style
  • 17. p { border-top-style: solid; border-right-style: dashed; border-bottom-style: double; border-left-style: dotted; width: 300px; height: 100px; }
  • 18. Specifying Border Width • Property: border-width – Values: length units, thin, medium, thick • More properties: border-top-width, border- right-width, border-bottom-width, border- left-width
  • 19. Specifying Border Color • Property: border-color • More Properties: border-top-color, border- right-color, border-bottom-color, border-left- color
  • 20. Specifying Border • You can provide style, width, and color values in one declaration p { border: 1px dashed #F26521; }
  • 21. Specifying Border • Can also use: border-top, border-right, border-bottom, border-left • Values for properties may include style, width, and color values in any order. • If the border style value is omitted, no border will show.
  • 22. Margin • Space added on the outside of the border • Optional.
  • 23. Specifying Margin • Similar to padding • margin-top, margin-right, margin-bottom, margin-left • Same short hands as padding apply
  • 24. Margins • The top and bottom margins of neighboring elements collapse. • Instead of accumulating, adjacent margins overlap, and only the largest value will be used
  • 25. Margins • Only horizontal margins are rendered on inline text elements • For non-text inline elements, margins rendered on all sides.