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

Php Using Arrays
Php Using ArraysPhp Using Arrays
Php Using Arrays
mussawir20
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
Varun C M
 
Data types in php
Data types in phpData types in php
Data types in php
ilakkiya
 

Tendances (20)

Sessions and cookies
Sessions and cookiesSessions and cookies
Sessions and cookies
 
Arrays in PHP
Arrays in PHPArrays in PHP
Arrays in PHP
 
CSS notes
CSS notesCSS notes
CSS notes
 
Css
CssCss
Css
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]
 
Php Using Arrays
Php Using ArraysPhp Using Arrays
Php Using Arrays
 
CSS
CSSCSS
CSS
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
 
Datatype in JavaScript
Datatype in JavaScriptDatatype in JavaScript
Datatype in JavaScript
 
Css pseudo-classes
Css pseudo-classesCss pseudo-classes
Css pseudo-classes
 
Css3
Css3Css3
Css3
 
Javascript
JavascriptJavascript
Javascript
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Data types in php
Data types in phpData types in php
Data types in php
 
Java script arrays
Java script arraysJava script arrays
Java script arrays
 
CSS selectors
CSS selectorsCSS selectors
CSS selectors
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 

En vedette

Final demo tle
Final demo   tleFinal demo   tle
Final demo tle
floeaz02
 

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 .pptx
stephen972973
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
Senthil Kumar
 
CssBackgroundImages
CssBackgroundImagesCssBackgroundImages
CssBackgroundImages
Ian Pollock
 
Css+tutorial+in+bangla
Css+tutorial+in+banglaCss+tutorial+in+bangla
Css+tutorial+in+bangla
jessicaemily
 
Web app development_html_css_03
Web app development_html_css_03Web app development_html_css_03
Web app development_html_css_03
Hassen Poreya
 
TIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideTIBCO General Interface - CSS Guide
TIBCO General Interface - CSS Guide
Rohan Chandane
 

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
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
CSS3 Backgrounds
CSS3 BackgroundsCSS3 Backgrounds
CSS3 Backgrounds
 
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
 
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
 
14- Learn CSS Fundamentals / Inheritance
14- Learn CSS Fundamentals / Inheritance14- Learn CSS Fundamentals / Inheritance
14- Learn CSS Fundamentals / Inheritance
 
2. react - native: basic
2. react - native: basic2. react - native: basic
2. react - native: basic
 
Css introduction
Css  introductionCss  introduction
Css introduction
 

Plus de Jesus Obenita Jr.

Session 2 test construction.mt's
Session 2   test construction.mt'sSession 2   test construction.mt's
Session 2 test construction.mt's
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;}