SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Background Values
Ivan Clark G Pasana
Sarah Krizel Cayacap
Neo De Villa
Christian Philipp Gomez
In these chapter,
you will learn about
the following CSS
background
properties:
Background-image
Background-color
Background-position
Background-repeat
Background (shorthand property)
Background-image
• This is where you put the image source, which may
be a relative or an absolute URL. The format
is: url(image_filename.extension or subfolder/img.
ext or http;//www.site.com/image/img.ext).
• The CSS background-image property has basic
support with the following browsers:
• Chrome
• Android
• Firefox (Gecko)
• Firefox Mobile (Gecko)
• Internet Explorer (IE)
• IE Phone
• Opera
• Opera Mobile
• Safari (WebKit)
• Safari Mobile
Background-image
Value Description
url
Location of the image resource
div { background-image:
url("/images/logo.png"); }
none
No text-decoration is applied to the text
div { background-image: none; }
inherit
Element will inherit the background-image
from its parent element
div { background-image: inherit; }
The background image for the element. It can be one of the following:
Background-image
• This example shows a bad combination of text and background image. The text is hardly readable:
Background-
color
The value in the
CSS background-
color property can
be expressed as a
hexadecimal
value, rgb value,
or as a named
color.
Background-color
values can be
expressed in
hexadecimal
values such as
#FFFFFF, #000000,
and #FF0000.
Background-color
values can be
expressed using
rgb such as
rgb(255,255,255),
rgb(0,0,0), and
rgb(255,0,0).
Background-color
values can be
expressed as
named colors such
as white, black,
and red.
Background-color
• On the web, most sites use white,
black, and gray as a background colors.
In choosing the background color, make
sure that this will not come into conflict
with the text color-light backgrounds
go perfect with dark texts and vice
versa—so users will have no problem
reading the page's content
Background-position
• If your image file is not big
enough to occupy the whole
page, you may
indicate exactly where you
wish to put it---top, bottom,
center, left, right, or a
combination of these (e.g.,
top left).
This Example where the background image
positioned in the center
Background-position
This example where the background image positioned centered at top.
Background-repeat
• You may tile your image file by using the value, repeat; repeat
it at the topmost and bottommost part, using repeat-y (on the y-
axis); repeat it side-by-side, using repeat-x (on the x-axis);
not repeat it at all, using no-repeat.
Background-repeat
Value Description
repeat
Image is repeated both horizontally and vertically
div { background-image: url("logo.png"); background-repeat:
repeat; }
repeat-x
Image is repeated horizontally
div { background-image: url("logo.png"); background-repeat:
repeat-x; }
repeat-y
Image is repeated vertically
div { background-image: url("logo.png"); background-repeat:
repeat-y; }
no-repeat
Image is not repeated
div { background-image: url("logo.png"); background-repeat:
no-repeat; }
Defines whether the background-image repeats. It can be one of the following:
Background-repeat
Here, the background image is repeated only horizontally.
Background-repeat
Here, the background image is repeated only vertically.
Background-repeat
Here, the background image is not repeated.
Background (shorthand property)
• To shorten the code, it is also possible to specify all the
background properties in one single property. This is called a
shorthand property.
Instead of writing:
Background (shorthand property)
You can use the shorthand property
Example:
Background (shorthand property)
Background (shorthand property)
• When using the shorthand property the order of the property values is:
• background-color
• background-image
• background-repeat
• background-position
• It does not matter if one of the property values is missing, as long as the
other ones are in this order. Note that we do not use the background-
attachment property in the examples above, as it does not have a value.
THANK YOU!

Weitere ähnliche Inhalte

Ähnlich wie Presentation-1-1.pptx

Practical Responsive Images - from Second Wednesday
Practical Responsive Images - from Second WednesdayPractical Responsive Images - from Second Wednesday
Practical Responsive Images - from Second WednesdayBen Seymour
 
16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / BackgroundIn a Rocket
 
Sensational css how to show off your super sweet
Sensational css  how to show off your super sweet Sensational css  how to show off your super sweet
Sensational css how to show off your super sweet karenalma
 
Web forms and html lecture Number 2
Web forms and html lecture Number 2Web forms and html lecture Number 2
Web forms and html lecture Number 2Mudasir Syed
 
Imagecon 2019 - Aaron Gustafson
Imagecon 2019 - Aaron GustafsonImagecon 2019 - Aaron Gustafson
Imagecon 2019 - Aaron GustafsonCloudinary
 
Sprites rollovers
Sprites rolloversSprites rollovers
Sprites rollovershstryk
 
Getting started with rails active storage wae
Getting started with rails active storage waeGetting started with rails active storage wae
Getting started with rails active storage waeBishal Khanal
 
Android 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkAndroid 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkJussi Pohjolainen
 
Css+tutorial+in+bangla
Css+tutorial+in+banglaCss+tutorial+in+bangla
Css+tutorial+in+banglajessicaemily
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeDerek Christensen
 
Below are questions that use the following image class- import assert.pdf
Below are questions that use the following image class-  import assert.pdfBelow are questions that use the following image class-  import assert.pdf
Below are questions that use the following image class- import assert.pdfrdzire2014
 
Using Tailwind Background Image Add Beautiful Images Easily.pdf
Using Tailwind Background Image Add Beautiful Images Easily.pdfUsing Tailwind Background Image Add Beautiful Images Easily.pdf
Using Tailwind Background Image Add Beautiful Images Easily.pdfRonDosh
 
CssBackgroundImages
CssBackgroundImagesCssBackgroundImages
CssBackgroundImagesIan Pollock
 
Presentation
PresentationPresentation
PresentationBbhulme1
 

Ähnlich wie Presentation-1-1.pptx (20)

Practical Responsive Images - from Second Wednesday
Practical Responsive Images - from Second WednesdayPractical Responsive Images - from Second Wednesday
Practical Responsive Images - from Second Wednesday
 
16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background
 
Sensational css how to show off your super sweet
Sensational css  how to show off your super sweet Sensational css  how to show off your super sweet
Sensational css how to show off your super sweet
 
basics of css
basics of cssbasics of css
basics of css
 
Lab#9 graphic and color
Lab#9 graphic and colorLab#9 graphic and color
Lab#9 graphic and color
 
Css3
Css3Css3
Css3
 
Web forms and html lecture Number 2
Web forms and html lecture Number 2Web forms and html lecture Number 2
Web forms and html lecture Number 2
 
Imagecon 2019 - Aaron Gustafson
Imagecon 2019 - Aaron GustafsonImagecon 2019 - Aaron Gustafson
Imagecon 2019 - Aaron Gustafson
 
Sprites rollovers
Sprites rolloversSprites rollovers
Sprites rollovers
 
Getting started with rails active storage wae
Getting started with rails active storage waeGetting started with rails active storage wae
Getting started with rails active storage wae
 
Android 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkAndroid 2D Drawing and Animation Framework
Android 2D Drawing and Animation Framework
 
lecture4.ppt
lecture4.pptlecture4.ppt
lecture4.ppt
 
Css+tutorial+in+bangla
Css+tutorial+in+banglaCss+tutorial+in+bangla
Css+tutorial+in+bangla
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to life
 
Below are questions that use the following image class- import assert.pdf
Below are questions that use the following image class-  import assert.pdfBelow are questions that use the following image class-  import assert.pdf
Below are questions that use the following image class- import assert.pdf
 
Using Tailwind Background Image Add Beautiful Images Easily.pdf
Using Tailwind Background Image Add Beautiful Images Easily.pdfUsing Tailwind Background Image Add Beautiful Images Easily.pdf
Using Tailwind Background Image Add Beautiful Images Easily.pdf
 
CSS Box Model
CSS Box ModelCSS Box Model
CSS Box Model
 
CssBackgroundImages
CssBackgroundImagesCssBackgroundImages
CssBackgroundImages
 
HTML 5_Canvas
HTML 5_CanvasHTML 5_Canvas
HTML 5_Canvas
 
Presentation
PresentationPresentation
Presentation
 

Kürzlich hochgeladen

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 

Kürzlich hochgeladen (20)

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 

Presentation-1-1.pptx

  • 1. Background Values Ivan Clark G Pasana Sarah Krizel Cayacap Neo De Villa Christian Philipp Gomez
  • 2. In these chapter, you will learn about the following CSS background properties: Background-image Background-color Background-position Background-repeat Background (shorthand property)
  • 3. Background-image • This is where you put the image source, which may be a relative or an absolute URL. The format is: url(image_filename.extension or subfolder/img. ext or http;//www.site.com/image/img.ext). • The CSS background-image property has basic support with the following browsers: • Chrome • Android • Firefox (Gecko) • Firefox Mobile (Gecko) • Internet Explorer (IE) • IE Phone • Opera • Opera Mobile • Safari (WebKit) • Safari Mobile
  • 4. Background-image Value Description url Location of the image resource div { background-image: url("/images/logo.png"); } none No text-decoration is applied to the text div { background-image: none; } inherit Element will inherit the background-image from its parent element div { background-image: inherit; } The background image for the element. It can be one of the following:
  • 5. Background-image • This example shows a bad combination of text and background image. The text is hardly readable:
  • 6. Background- color The value in the CSS background- color property can be expressed as a hexadecimal value, rgb value, or as a named color. Background-color values can be expressed in hexadecimal values such as #FFFFFF, #000000, and #FF0000. Background-color values can be expressed using rgb such as rgb(255,255,255), rgb(0,0,0), and rgb(255,0,0). Background-color values can be expressed as named colors such as white, black, and red.
  • 7. Background-color • On the web, most sites use white, black, and gray as a background colors. In choosing the background color, make sure that this will not come into conflict with the text color-light backgrounds go perfect with dark texts and vice versa—so users will have no problem reading the page's content
  • 8. Background-position • If your image file is not big enough to occupy the whole page, you may indicate exactly where you wish to put it---top, bottom, center, left, right, or a combination of these (e.g., top left). This Example where the background image positioned in the center
  • 9. Background-position This example where the background image positioned centered at top.
  • 10. Background-repeat • You may tile your image file by using the value, repeat; repeat it at the topmost and bottommost part, using repeat-y (on the y- axis); repeat it side-by-side, using repeat-x (on the x-axis); not repeat it at all, using no-repeat.
  • 11. Background-repeat Value Description repeat Image is repeated both horizontally and vertically div { background-image: url("logo.png"); background-repeat: repeat; } repeat-x Image is repeated horizontally div { background-image: url("logo.png"); background-repeat: repeat-x; } repeat-y Image is repeated vertically div { background-image: url("logo.png"); background-repeat: repeat-y; } no-repeat Image is not repeated div { background-image: url("logo.png"); background-repeat: no-repeat; } Defines whether the background-image repeats. It can be one of the following:
  • 12. Background-repeat Here, the background image is repeated only horizontally.
  • 13. Background-repeat Here, the background image is repeated only vertically.
  • 14. Background-repeat Here, the background image is not repeated.
  • 15. Background (shorthand property) • To shorten the code, it is also possible to specify all the background properties in one single property. This is called a shorthand property. Instead of writing:
  • 16. Background (shorthand property) You can use the shorthand property Example:
  • 18. Background (shorthand property) • When using the shorthand property the order of the property values is: • background-color • background-image • background-repeat • background-position • It does not matter if one of the property values is missing, as long as the other ones are in this order. Note that we do not use the background- attachment property in the examples above, as it does not have a value.

Hinweis der Redaktion

  1. 1