SlideShare une entreprise Scribd logo
1  sur  14
Unit III: Adding Styles
and Interactivity Using
  CSS and Javascript
REVIEW
•   The acronym CSS stands for?
•   What is the main purpose of the CSS?
•   CSS allows you to?
•   What is the basic syntax of the CSS?
•   What are the three styles of CSS?
•   Which style is known as the attribute style?
•   Which style is specified within the head tag?
•   It is a text file with .css extension.
RED
BLUE
GREEN
YELLOW
ORANGE
 VIOLET
BLUE      RED
VIOLET   YELLOW

GREEN    ORANGE
CSS Properties
• To be able to design a Web page
  with CSS , one must know the
  different properties that can be
  applied via CSS. Most of the
  properties are very similar to
  HTML. All of the properties can
  be applied on all CSS style.
CSS Color and Background
       Properties
Property         Description               Example
                   Sets the foreground
     color         color of an element   body{color: #FCC9814;}
                   Sets the background body{background-color:
 background-color color of an element            green;}
                   Inserts a background body{background-image:
background-image           image           url (“earth.gif”);}
                       Specifies how
                  background image will
                    repeat itself. It may
                    repeat horizontally
                    (repeat-x) vertically
                  (repeat-y) or (repeat)
                       or may not be
                  repeated (no-repeat) body{background-repeat:
background-repeat                               repeat-x;}
BASIC SYNTAX OF AN CSS INLINE STYLE
<html>
<body style= "background: green; color: white;">
Then type the text
<p style= "background: blue; color: white;">
Then type the text
<p style= "background: red; color: yellow;">
Then type the text
</body>
</html>
BASIC SYNTAX OF CSS INTERNAL STYLE
 <html>
 <head><title>CSS</title>
 <style type= "text/css">
 body{background: red url("deped.jpg") repeat-y
 center scroll;}
 h1{background:yellow url("deped.jpg");}
 </style>
 <h1>Where</h1>
 </body>
 </html>
Property               Description                     Example
              Sets whether a background image is body{background
Background-   locked (fixed) or scrolls (scroll) along -attachment:
attachment                 with the page                    fixed;}
                Changes the default position (top,
                 left, corner) of the background
              image to any specified location. The
                   screen coordinates may be
                    indicated in percentages,
               centimeters or using the terms top, Body{background
Background-      bottom, center, left or right (eg.    -position: right
  position     25% 50% 5 cm 10 cm, right center).          center;}
                                                      Body{background
                                                            : green
                                                       url(“earth.gif”)
                Sets all background properties in       repeat-x fixed
background                one declaration.              right center;}
RULES
1. When setting background properties in one
  declaration, semi-colon (;) is only inserted at
  the end, before the closing curly bracket.
Ex. body{background: red url(“logo.jpg”)
  repeat-y fixed center;}
2. Do not use the color properties, when you
  used image as a background.
3. You can not use background-image properties
  when using inline style of css.
COMPUQUIZ
1. Write the full CSS code to set the body
   foreground to yellow and background to red.
2. Write the full CSS code to set the image
   wallpaper_1.jpg as background.
3. Write the full CSS code to repeat the background
   vertically.
4. Write the full CSS code to set the image position
   to the left.
5. Set the CSS Background Properties from no. 2-4
   in one declaration.
PERFORMANCE TEST
• Write the full CSS code to set the body
  background to green, foreground to
  white using inline style.
• Write the full CSS code to use
  “image_7.png as background and set the
  ff. values fixed, repeat-y, top right in one
  declaration using internal style.
ANSWER
1. body{ color: yellow; background-color: red; }
2. body{ background-image: url
   (“wallpaper_1.jpg”);}
3. body{ background-repeat: repeat-y ;}
4. body{ background-position: left ;}
5. Body{background: url (“wallpaper_1.jpg”)
   repeat-y left;}

Contenu connexe

Tendances (20)

Css ppt
Css pptCss ppt
Css ppt
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
 
Css
CssCss
Css
 
CSS selectors
CSS selectorsCSS selectors
CSS selectors
 
Presentation on html, css
Presentation on html, cssPresentation on html, css
Presentation on html, css
 
Css Basics
Css BasicsCss Basics
Css Basics
 
Html introduction
Html introductionHtml introduction
Html introduction
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Introduction to flexbox
Introduction  to  flexboxIntroduction  to  flexbox
Introduction to flexbox
 
CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations
 
Css position
Css positionCss position
Css position
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
Css
CssCss
Css
 
(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS
 
Bootstrap 5 ppt
Bootstrap 5 pptBootstrap 5 ppt
Bootstrap 5 ppt
 
Box Model
Box ModelBox Model
Box Model
 
CSS
CSSCSS
CSS
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
 
Css backgrounds
Css   backgroundsCss   backgrounds
Css backgrounds
 
Bootstrap 3
Bootstrap 3Bootstrap 3
Bootstrap 3
 

En vedette

Basic Html Knowledge for students
Basic Html Knowledge for studentsBasic Html Knowledge for students
Basic Html Knowledge for studentsvethics
 
Basic html for Normal People
Basic html for Normal PeopleBasic html for Normal People
Basic html for Normal PeopleTed Curran
 
Introduction to basic HTML [Librarian edition]
Introduction to basic HTML [Librarian edition]Introduction to basic HTML [Librarian edition]
Introduction to basic HTML [Librarian edition]Kosie Eloff
 
Basic HTML
Basic HTMLBasic HTML
Basic HTMLSayan De
 
Lesson Plan in Technical Livelihood Education (TLE)
Lesson Plan in Technical Livelihood Education (TLE)Lesson Plan in Technical Livelihood Education (TLE)
Lesson Plan in Technical Livelihood Education (TLE)Cristina Protacio, LPT
 
Final demo tle
Final demo   tleFinal demo   tle
Final demo tlefloeaz02
 
Final Demo Semi Detailed Lesson Plan in TLE 2 (LAN Cabling)
Final Demo Semi Detailed Lesson Plan in TLE 2 (LAN Cabling)Final Demo Semi Detailed Lesson Plan in TLE 2 (LAN Cabling)
Final Demo Semi Detailed Lesson Plan in TLE 2 (LAN Cabling)Manila Central University
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTMLMayaLisa
 

En vedette (11)

belajar HTML
belajar HTML belajar HTML
belajar HTML
 
Basic Html Knowledge for students
Basic Html Knowledge for studentsBasic Html Knowledge for students
Basic Html Knowledge for students
 
Perencanaan sumberdaya manusia
Perencanaan sumberdaya manusiaPerencanaan sumberdaya manusia
Perencanaan sumberdaya manusia
 
Basic html for Normal People
Basic html for Normal PeopleBasic html for Normal People
Basic html for Normal People
 
Introduction to basic HTML [Librarian edition]
Introduction to basic HTML [Librarian edition]Introduction to basic HTML [Librarian edition]
Introduction to basic HTML [Librarian edition]
 
Html basic
Html basicHtml basic
Html basic
 
Basic HTML
Basic HTMLBasic HTML
Basic HTML
 
Lesson Plan in Technical Livelihood Education (TLE)
Lesson Plan in Technical Livelihood Education (TLE)Lesson Plan in Technical Livelihood Education (TLE)
Lesson Plan in Technical Livelihood Education (TLE)
 
Final demo tle
Final demo   tleFinal demo   tle
Final demo tle
 
Final Demo Semi Detailed Lesson Plan in TLE 2 (LAN Cabling)
Final Demo Semi Detailed Lesson Plan in TLE 2 (LAN Cabling)Final Demo Semi Detailed Lesson Plan in TLE 2 (LAN Cabling)
Final Demo Semi Detailed Lesson Plan in TLE 2 (LAN Cabling)
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 

Similaire à Css color and background properties

Cascading Style Sheets Background .pptx
Cascading Style Sheets Background  .pptxCascading Style Sheets Background  .pptx
Cascading Style Sheets Background .pptxstephen972973
 
Presentation-1-1.pptx
Presentation-1-1.pptxPresentation-1-1.pptx
Presentation-1-1.pptxIvanPasana
 
Background property in css
Background property in cssBackground property in css
Background property in cssDhruvin Nakrani
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style SheetsSenthil Kumar
 
CssBackgroundImages
CssBackgroundImagesCssBackgroundImages
CssBackgroundImagesIan Pollock
 
Web Design Course: CSS lecture 2
Web Design Course: CSS  lecture 2Web Design Course: CSS  lecture 2
Web Design Course: CSS lecture 2Gheyath M. Othman
 
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017Codemotion
 
Css+tutorial+in+bangla
Css+tutorial+in+banglaCss+tutorial+in+bangla
Css+tutorial+in+banglajessicaemily
 
Web app development_html_css_03
Web app development_html_css_03Web app development_html_css_03
Web app development_html_css_03Hassen Poreya
 
TIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideTIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideRohan Chandane
 
ID01 Week 3
ID01 Week 3ID01 Week 3
ID01 Week 3mkontopo
 
Implementing CSS support for React Native
Implementing CSS support for React NativeImplementing CSS support for React Native
Implementing CSS support for React NativeKristerKari
 

Similaire à Css color and background properties (20)

Cascading Style Sheets Background .pptx
Cascading Style Sheets Background  .pptxCascading Style Sheets Background  .pptx
Cascading Style Sheets Background .pptx
 
Background
BackgroundBackground
Background
 
Presentation-1-1.pptx
Presentation-1-1.pptxPresentation-1-1.pptx
Presentation-1-1.pptx
 
basics of css
basics of cssbasics of css
basics of css
 
Background property in css
Background property in cssBackground property in css
Background property in css
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
CSS3 Backgrounds
CSS3 BackgroundsCSS3 Backgrounds
CSS3 Backgrounds
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
CssBackgroundImages
CssBackgroundImagesCssBackgroundImages
CssBackgroundImages
 
Web Design Course: CSS lecture 2
Web Design Course: CSS  lecture 2Web Design Course: CSS  lecture 2
Web Design Course: CSS lecture 2
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
 
Css+tutorial+in+bangla
Css+tutorial+in+banglaCss+tutorial+in+bangla
Css+tutorial+in+bangla
 
Web app development_html_css_03
Web app development_html_css_03Web app development_html_css_03
Web app development_html_css_03
 
CSS
CSSCSS
CSS
 
TIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideTIBCO General Interface - CSS Guide
TIBCO General Interface - CSS Guide
 
Ict 8 css
Ict 8 cssIct 8 css
Ict 8 css
 
CSS notes
CSS notesCSS notes
CSS notes
 
ID01 Week 3
ID01 Week 3ID01 Week 3
ID01 Week 3
 
Implementing CSS support for React Native
Implementing CSS support for React NativeImplementing CSS support for React Native
Implementing CSS support for React Native
 

Plus de Jesus Obenita Jr.

Plus de Jesus Obenita Jr. (20)

Organization and management 3 a Evolution of Management Theory
Organization and management 3 a Evolution of Management TheoryOrganization and management 3 a Evolution of Management Theory
Organization and management 3 a Evolution of Management Theory
 
Organization and management 2 Management Function
Organization and management 2 Management FunctionOrganization and management 2 Management Function
Organization and management 2 Management Function
 
Organization and management 1
Organization and management 1Organization and management 1
Organization and management 1
 
Designing web page marquee and img tag
Designing web page  marquee and img tagDesigning web page  marquee and img tag
Designing web page marquee and img tag
 
Ms excel 2013 formatting worksheets
Ms excel 2013 formatting worksheetsMs excel 2013 formatting worksheets
Ms excel 2013 formatting worksheets
 
Ms excel 2013 data management
Ms excel 2013 data managementMs excel 2013 data management
Ms excel 2013 data management
 
Microsoft Excel introduction
Microsoft Excel introductionMicrosoft Excel introduction
Microsoft Excel introduction
 
Word 2013 working with pictures
Word 2013 working with picturesWord 2013 working with pictures
Word 2013 working with pictures
 
Word 2013 Formatting Page
Word 2013 Formatting PageWord 2013 Formatting Page
Word 2013 Formatting Page
 
Word 2013 8
Word 2013 8Word 2013 8
Word 2013 8
 
Ms word 2013 7
Ms word 2013 7Ms word 2013 7
Ms word 2013 7
 
Ms word 2013 6
Ms word 2013 6Ms word 2013 6
Ms word 2013 6
 
Ms word 2013 4
Ms word 2013 4Ms word 2013 4
Ms word 2013 4
 
Ms word 2013 2
Ms word 2013 2Ms word 2013 2
Ms word 2013 2
 
Ms word 2013
Ms word 2013Ms word 2013
Ms word 2013
 
Parts of the ms word 2013 screen and
Parts of the ms word 2013 screen andParts of the ms word 2013 screen and
Parts of the ms word 2013 screen and
 
Word processor
Word processorWord processor
Word processor
 
Session 2 test construction.mt's
Session 2   test construction.mt'sSession 2   test construction.mt's
Session 2 test construction.mt's
 
Cooking ingredients
Cooking ingredientsCooking ingredients
Cooking ingredients
 
Color theory
Color theoryColor theory
Color theory
 

Css color and background properties

  • 1. Unit III: Adding Styles and Interactivity Using CSS and Javascript
  • 2. REVIEW • The acronym CSS stands for? • What is the main purpose of the CSS? • CSS allows you to? • What is the basic syntax of the CSS? • What are the three styles of CSS? • Which style is known as the attribute style? • Which style is specified within the head tag? • It is a text file with .css extension.
  • 4. BLUE RED VIOLET YELLOW GREEN ORANGE
  • 5. CSS Properties • To be able to design a Web page with CSS , one must know the different properties that can be applied via CSS. Most of the properties are very similar to HTML. All of the properties can be applied on all CSS style.
  • 6. CSS Color and Background Properties
  • 7. Property Description Example Sets the foreground color color of an element body{color: #FCC9814;} Sets the background body{background-color: background-color color of an element green;} Inserts a background body{background-image: background-image image url (“earth.gif”);} Specifies how background image will repeat itself. It may repeat horizontally (repeat-x) vertically (repeat-y) or (repeat) or may not be repeated (no-repeat) body{background-repeat: background-repeat repeat-x;}
  • 8. BASIC SYNTAX OF AN CSS INLINE STYLE <html> <body style= "background: green; color: white;"> Then type the text <p style= "background: blue; color: white;"> Then type the text <p style= "background: red; color: yellow;"> Then type the text </body> </html>
  • 9. BASIC SYNTAX OF CSS INTERNAL STYLE <html> <head><title>CSS</title> <style type= "text/css"> body{background: red url("deped.jpg") repeat-y center scroll;} h1{background:yellow url("deped.jpg");} </style> <h1>Where</h1> </body> </html>
  • 10. Property Description Example Sets whether a background image is body{background Background- locked (fixed) or scrolls (scroll) along -attachment: attachment with the page fixed;} Changes the default position (top, left, corner) of the background image to any specified location. The screen coordinates may be indicated in percentages, centimeters or using the terms top, Body{background Background- bottom, center, left or right (eg. -position: right position 25% 50% 5 cm 10 cm, right center). center;} Body{background : green url(“earth.gif”) Sets all background properties in repeat-x fixed background one declaration. right center;}
  • 11. RULES 1. When setting background properties in one declaration, semi-colon (;) is only inserted at the end, before the closing curly bracket. Ex. body{background: red url(“logo.jpg”) repeat-y fixed center;} 2. Do not use the color properties, when you used image as a background. 3. You can not use background-image properties when using inline style of css.
  • 12. COMPUQUIZ 1. Write the full CSS code to set the body foreground to yellow and background to red. 2. Write the full CSS code to set the image wallpaper_1.jpg as background. 3. Write the full CSS code to repeat the background vertically. 4. Write the full CSS code to set the image position to the left. 5. Set the CSS Background Properties from no. 2-4 in one declaration.
  • 13. PERFORMANCE TEST • Write the full CSS code to set the body background to green, foreground to white using inline style. • Write the full CSS code to use “image_7.png as background and set the ff. values fixed, repeat-y, top right in one declaration using internal style.
  • 14. ANSWER 1. body{ color: yellow; background-color: red; } 2. body{ background-image: url (“wallpaper_1.jpg”);} 3. body{ background-repeat: repeat-y ;} 4. body{ background-position: left ;} 5. Body{background: url (“wallpaper_1.jpg”) repeat-y left;}