際際滷

際際滷Share a Scribd company logo
CSS Rule

Selector               Declaration Block


 body {
     font-family: Tahoma, Arial, sans-serif;
     color: black;
     background: white;
     margin: 8px;
 }

                           Value
 Attribute Name


              CS 142 Lecture Notes: CSS    際際滷 1
Adding Styles to HTML
                                 Separate Stylesheet
<head>
  ...
  <link rel="stylesheet" type="text/css" href="myStyles.css" />
  <style type="text/css">
    body {
        font-family: Tahoma, Arial, sans-serif;
        ...
    }
  </style>
</head>
<body>                                 Page-Specific Styles
  ...
  <div style=padding:2px; ... ">
  ...
</body>



                     Element-Specific Styles
                     CS 142 Lecture Notes: CSS    際際滷 2
CSS:                                         HTML:
body {                                       <body>
   font-family: Tahoma, Arial, sans-serif;     <h1>First Section Heading</h1>
   font-size: 13px;                            <p>
   color: black;                                  Here is the first paragraph, containing
   background: white;                             text that really doesn't have any use
   margin: 8px;                                   or meaning; it just prattles on and on,
}                                                 with no end whatsoever, no point to
h1 {                                              make, really no purpose for existence
   font-size: 19px;                               at all.
   margin-top: 15px;                           </p>
   margin-bottom: 5px;                         <div class="shaded">
   border-bottom: 1px solid black                 <h1>Another Section Heading</h1>
}                                                 <p>
.shaded {                                           Another paragraph.
   background: #d0d0ff;                           </p>
}                                              </div>
                                             </body>




                               CS 142 Lecture Notes: CSS          際際滷 3
CSS Color Specifiers
 Predefined names:
   white black red 

 8-bit hexadecimal intensities for red, green, blue:

   #ff0000
     R G B

 0-255 decimal intensities:
   rgb(255,255,0)
         R     G   B
 Percentage intensities:
   rgb(80%,80%,100%)
          R    G    B
                   CS 142 Lecture Notes: CSS   際際滷 4
CSS Element Boxes
Parents background covers margin                   Border

                          Margin



                         Element
                         Content
                          Padding




                         Padding


                   Elements background covers padding
                  CS 142 Lecture Notes: CSS   際際滷 5
CSS Distances

2px           pixels
1mm           millimeters
2cm           centimeters
0.2in         inches
3pt           printers points
2em, 4ex      other printers units




  CS 142 Lecture Notes: CSS      際際滷 6
CS 142 Lecture Notes: CSS   際際滷 7
Ad

Recommended

Intro to SASS CSS
Intro to SASS CSS
Kianosh Pourian
Sass presentation
Sass presentation
Davin Abraham
Intro to css & sass
Intro to css & sass
Sean Wolfe
Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02
Hatem Mahmoud
Oocss & progressive css3 selectors
Oocss & progressive css3 selectors
daniel_sternlicht
CSS and Layout
CSS and Layout
Jussi Pohjolainen
Efficient, maintainable CSS
Efficient, maintainable CSS
Russ Weakley
Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2
Nur Fadli Utomo
CSS Extenders
CSS Extenders
Idan Gazit
CSS Walktrough Internship Course
CSS Walktrough Internship Course
Zoltan Iszlai
Css box-model
Css box-model
Webtech Learning
Intro to CSS
Intro to CSS
Randy Oest II
CSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box Model
jamiecavanaugh
CSS ppt
CSS ppt
Sanmuga Nathan
Sass
Sass
Bram Verdyck
CSS Part I
CSS Part I
Doncho Minkov
Css3 101
Css3 101
Ignacio Coloma
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Kaelig Deloumeau-Prigent
CSS Basics
CSS Basics
WordPress Memphis
CSS Reset
CSS Reset
Russ Weakley
Css3
Css3
Vladimir Varun
PLAT-11 Moving from Lucene to Alfresco FTS
PLAT-11 Moving from Lucene to Alfresco FTS
Alfresco Software
CSS Box Model Presentation
CSS Box Model Presentation
Reed Crouch
Css for nondesigners
Css for nondesigners
Ignacio Coloma
Sass presentation
Sass presentation
舒从仂 仂于舒亠于亳
[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop
Christopher Schmitt
CSS
CSS
Mallikarjuna G D
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
AakankshaR
BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby

More Related Content

What's hot (20)

CSS Extenders
CSS Extenders
Idan Gazit
CSS Walktrough Internship Course
CSS Walktrough Internship Course
Zoltan Iszlai
Css box-model
Css box-model
Webtech Learning
Intro to CSS
Intro to CSS
Randy Oest II
CSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box Model
jamiecavanaugh
CSS ppt
CSS ppt
Sanmuga Nathan
Sass
Sass
Bram Verdyck
CSS Part I
CSS Part I
Doncho Minkov
Css3 101
Css3 101
Ignacio Coloma
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Kaelig Deloumeau-Prigent
CSS Basics
CSS Basics
WordPress Memphis
CSS Reset
CSS Reset
Russ Weakley
Css3
Css3
Vladimir Varun
PLAT-11 Moving from Lucene to Alfresco FTS
PLAT-11 Moving from Lucene to Alfresco FTS
Alfresco Software
CSS Box Model Presentation
CSS Box Model Presentation
Reed Crouch
Css for nondesigners
Css for nondesigners
Ignacio Coloma
Sass presentation
Sass presentation
舒从仂 仂于舒亠于亳
[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop
Christopher Schmitt
CSS
CSS
Mallikarjuna G D
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
AakankshaR

Similar to Css (1) (20)

BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
Tom Hapgood
Cascade.ss
Cascade.ss
baabtra.com - No. 1 supplier of quality freshers
Css 1
Css 1
H K
CSS.pptx
CSS.pptx
PrashantRawat63
Unitegergergegegegetgegegegegegeg-2-CSS.pptx
Unitegergergegegegetgegegegegegeg-2-CSS.pptx
VikasTuwar1
Introdu巽達o a CSS
Introdu巽達o a CSS
Tiago Santos
Make Css easy : easy tips for css
Make Css easy : easy tips for css
shabab shihan
CSS
CSS
anandha ganesh
Web Programming-css.pptx
Web Programming-css.pptx
MarwaAnany1
Css siva
Css siva
ch samaram
Css siva
Css siva
ch samaram
CSS Basic and Common Errors
CSS Basic and Common Errors
Hock Leng PUAH
Css
Css
MAGNA COLLEGE OF ENGINEERING
CSS
CSS
DivyaKS12
CSS
CSS
Deepa Lakshmi
Intro to CSS
Intro to CSS
UC Berkeley Graduate School of Journalism
4_css_intro.pptx. this ppt is based on css which is the required of web deve...
4_css_intro.pptx. this ppt is based on css which is the required of web deve...
sindwanigripsi
Demystifying CSS & WordPress
Demystifying CSS & WordPress
Justin Carmony
Ad

Css (1)

  • 1. CSS Rule Selector Declaration Block body { font-family: Tahoma, Arial, sans-serif; color: black; background: white; margin: 8px; } Value Attribute Name CS 142 Lecture Notes: CSS 際際滷 1
  • 2. Adding Styles to HTML Separate Stylesheet <head> ... <link rel="stylesheet" type="text/css" href="myStyles.css" /> <style type="text/css"> body { font-family: Tahoma, Arial, sans-serif; ... } </style> </head> <body> Page-Specific Styles ... <div style=padding:2px; ... "> ... </body> Element-Specific Styles CS 142 Lecture Notes: CSS 際際滷 2
  • 3. CSS: HTML: body { <body> font-family: Tahoma, Arial, sans-serif; <h1>First Section Heading</h1> font-size: 13px; <p> color: black; Here is the first paragraph, containing background: white; text that really doesn't have any use margin: 8px; or meaning; it just prattles on and on, } with no end whatsoever, no point to h1 { make, really no purpose for existence font-size: 19px; at all. margin-top: 15px; </p> margin-bottom: 5px; <div class="shaded"> border-bottom: 1px solid black <h1>Another Section Heading</h1> } <p> .shaded { Another paragraph. background: #d0d0ff; </p> } </div> </body> CS 142 Lecture Notes: CSS 際際滷 3
  • 4. CSS Color Specifiers Predefined names: white black red 8-bit hexadecimal intensities for red, green, blue: #ff0000 R G B 0-255 decimal intensities: rgb(255,255,0) R G B Percentage intensities: rgb(80%,80%,100%) R G B CS 142 Lecture Notes: CSS 際際滷 4
  • 5. CSS Element Boxes Parents background covers margin Border Margin Element Content Padding Padding Elements background covers padding CS 142 Lecture Notes: CSS 際際滷 5
  • 6. CSS Distances 2px pixels 1mm millimeters 2cm centimeters 0.2in inches 3pt printers points 2em, 4ex other printers units CS 142 Lecture Notes: CSS 際際滷 6
  • 7. CS 142 Lecture Notes: CSS 際際滷 7