SlideShare a Scribd company logo
CSS
Cascading Style Sheets
Parts of a CSS rule


h2 {
color: #000000;
}
Parts of a CSS rule


h2 {
color: #000000;
}
        SELECTOR
Parts of a CSS rule


h2 {
color: #000000;
}
     CURLY BRACKETS
Parts of a CSS rule


h2 {
color: #000000;
}
        PROPERTY
Parts of a CSS rule


h2 {
color: #000000;
}
         VALUE
Parts of a CSS rule


h2 {
color: #000000;
}
   START WITH SELECTOR
Three Kinds of Selectors
TYPE SELECTORS   CLASS SELECTORS   ID SELECTORS

div              .headlines        #container
p                .paragraphs       #first-­‐article
h2               .bylines          #footer
strong           .summary          #sidebar
Type Selectors
                               <body>
h2 {                            <div id=“container”>

                                  <h2 class=“headline”>Hello World</h2>
    font-style: bold;
                                  <p class=“byline”>By Jeremy Rue.</p>
}
                                  <p>In todayʼs news, a class at UC Berkeley
                                  learned the importance of CSS in designing
                                  and building webpages.</p>

p{                                <div id=“sidebar”>
                                    <h2>Side Bar Story</h2>
                                    <p class=“byline”>By John Doe.</p>
    font-family: Helvetica;         <p>This is a related story.</p>
                                  </div>
}
                                 </div>
                               </body>
Type Selectors
                               <body>
h2 {                            <div id=“container”>

                                  <h2 class=“headline”>Hello World</h2>
    font-style: bold;
                                  <p class=“byline”>By Jeremy Rue.</p>
}
                                  <p>In todayʼs news, a class at UC Berkeley
                                  learned the importance of CSS in designing
                                  and building webpages.</p>

p{                                <div id=“sidebar”>
                                    <h2>Side Bar Story</h2>
                                    <p class=“byline”>By John Doe.</p>
    font-family: Helvetica;         <p>This is a related story.</p>
                                  </div>
}
                                 </div>
                               </body>
Class Selectors
                                  <body>
.headline {                        <div id=“container”>

                                     <h2 class=“headline”>Hello World</h2>
    text-decoration: underline;
                                     <p class=“byline”>By Jeremy Rue.</p>
}
                                     <p>In todayʼs news, a class at UC Berkeley
                                     learned the importance of CSS in designing
                                     and building webpages.</p>

.byline {                            <div id=“sidebar”>
                                       <h2>Side Bar Story</h2>
                                       <p class=“byline”>By John Doe.</p>
    font-size: 8px;                    <p>This is a related story.</p>
                                     </div>
}
                                    </div>
                                  </body>
Class Selectors
                                  <body>
.headline {                        <div id=“container”>

                                     <h2 class=“headline”>Hello World</h2>
    text-decoration: underline;
                                     <p class=“byline”>By Jeremy Rue.</p>
}
                                     <p>In todayʼs news, a class at UC Berkeley
                                     learned the importance of CSS in designing
                                     and building webpages.</p>

.byline {                            <div id=“sidebar”>
                                       <h2>Side Bar Story</h2>
                                       <p class=“byline”>By John Doe.</p>
    font-size: 8px;                    <p>This is a related story.</p>
                                     </div>
}
                                    </div>
                                  </body>
ID Selectors
                             <body>
#container {                  <div id=“container”>

                                <h2 class=“headline”>Hello World</h2>
    font-size: 30px;
                                <p class=“byline”>By Jeremy Rue.</p>
}
                                <p>In todayʼs news, a class at UC Berkeley
                                learned the importance of CSS in designing
                                and building webpages.</p>

#sidebar {                      <div id=“sidebar”>
                                  <h2>Side Bar Story</h2>
                                  <p class=“byline”>By John Doe.</p>
    font-size: 8px;               <p>This is a related story.</p>
                                </div>
}
                               </div>
                             </body>
ID Selectors
                             <body>
#container {                  <div id=“container”>

                                <h2 class=“headline”>Hello World</h2>
    font-size: 30px;
                                <p class=“byline”>By Jeremy Rue.</p>
}
                                <p>In todayʼs news, a class at UC Berkeley
                                learned the importance of CSS in designing
                                and building webpages.</p>

#sidebar {                      <div id=“sidebar”>
                                  <h2>Side Bar Story</h2>
                                  <p class=“byline”>By John Doe.</p>
    font-size: 8px;               <p>This is a related story.</p>
                                </div>
}
                               </div>
                             </body>
More ways to use selectors
More Selector Options
                          <body>
.headline{                 <div id=“container”>

                             <h2 class=“headline”>Hello World</h2>
    font-size: 30px;
                             <p class=“byline”>By Jeremy Rue.</p>
}
                             <p>In todayʼs news, a class at UC Berkeley
                             learned the importance of CSS in designing
                             and building webpages.</p>

                             <div id=“sidebar”>
                               <h3 class=“headline”>Side Bar Story</h3>
                               <p class=“byline”>By John Doe.</p>
                               <p>This is a related story.</p>
                             </div>

                            </div>
                          </body>
More Selector Options
                          <body>
h2.headline {              <div id=“container”>

                             <h2 class=“headline”>Hello World</h2>
    font-size: 30px;
                             <p class=“byline”>By Jeremy Rue.</p>
}
                             <p>In todayʼs news, a class at UC Berkeley
                             learned the importance of CSS in designing
                             and building webpages.</p>

                             <div id=“sidebar”>
                               <h3 class=“headline”>Side Bar Story</h3>
                               <p class=“byline”>By John Doe.</p>
                               <p>This is a related story.</p>
                             </div>

                            </div>
                          </body>
More Selector Options
                          <body>
#sidebar p {               <div id=“container”>

                             <h2 class=“headline”>Hello World</h2>
    font-size: 30px;
                             <p class=“byline”>By Jeremy Rue.</p>
}
                             <p>In todayʼs news, a class at UC Berkeley
                             learned the importance of CSS in designing
                             and building webpages.</p>

A space means                <div id=“sidebar”>
descendant.                    <h3 class=“headline”>Side Bar Story</h3>
                               <p class=“byline”>By John Doe.</p>
                               <p>This is a related story.</p>
                             </div>

                            </div>
                          </body>
More Selector Options
                           <body>
#container #sidebar h3 {    <div id=“container”>

                              <h2 class=“headline”>Hello World</h2>
    font-size: 30px;
                              <p class=“byline”>By Jeremy Rue.</p>
}
                              <p>In todayʼs news, a class at UC Berkeley
                              learned the importance of CSS in designing
                              and building webpages.</p>

                              <div id=“sidebar”>
                                <h3 class=“headline”>Side Bar Story</h3>
                                <p class=“byline”>By John Doe.</p>
                                <p>This is a related story.</p>
                              </div>

                             </div>
                           </body>
More Selector Options
                           <body>
#container #sidebar h3 {    <div id=“container”>

                              <h2 class=“headline”>Hello World</h2>
    font-size: 30px;
                              <p class=“byline”>By Jeremy Rue.</p>
}
                              <p>In todayʼs news, a class at UC Berkeley
                              learned the importance of CSS in designing
                              and building webpages.</p>

                              <div id=“sidebar”>
                                <h3 class=“headline”>Side Bar Story</h3>
                                <p class=“byline”>By John Doe.</p>
                                <p>This is a related story.</p>
                              </div>

                             </div>
                           </body>
More Selector Options
                           <body>
#container #sidebar h3 {    <div id=“container”>

                              <h2 class=“headline”>Hello World</h2>
    font-size: 30px;
                              <p class=“byline”>By Jeremy Rue.</p>
}
                              <p>In todayʼs news, a class at UC Berkeley
                              learned the importance of CSS in designing
                              and building webpages.</p>

                              <div id=“sidebar”>
                                <h3 class=“headline”>Side Bar Story</h3>
                                <p class=“byline”>By John Doe.</p>
                                <p>This is a related story.</p>
                              </div>

                             </div>
                           </body>
More Selector Options
                           <body>
#container #sidebar h3 {    <div id=“container”>

                              <h2 class=“headline”>Hello World</h2>
    font-size: 30px;
                              <p class=“byline”>By Jeremy Rue.</p>
}
                              <p>In todayʼs news, a class at UC Berkeley
                              learned the importance of CSS in designing
                              and building webpages.</p>

                              <div id=“sidebar”>
                                <h3 class=“headline”>Side Bar Story</h3>
                                <p class=“byline”>By John Doe.</p>
                                <p>This is a related story.</p>
                              </div>

                             </div>
                           </body>
NOT to be confused with...
HTML vs CSS
               HTML                                          CSS

<div class=“headline lead-story article”>                .headline p {

                                                         }

              These spaces give multiple classes   This space means a <p> tag inside
                                                    another tag with class .headline
Example from Richmond Site


<div id="post-38661" class="hentry p1 post publish author-lexi-
pandell category-education category-featured category-front
tag-big-brother-big-sister tag-mentoring tag-nonprofit tag-
youth y2012 m02 d07 h13">
A few others
                                 <div id=“container”>
h3, p { color:orange; }
                                  <h3>Here is one headline</h3>

                                  <div>
                                   <h3>Another</h3>
                                   <p>Some text here</p>
                                  </div>

                                  <p>Another paragraph.</p>
                                  <h3>Last graph.</h3>

                                 </div>
A few others
                                    <div id=“container”>
#container > h3 { color:orange; }
                                     <h3>Here is one headline</h3>

                                     <div>
                                      <h3>Another</h3>
                                      <p>Some text here</p>
                                     </div>

                                     <p>Another paragraph.</p>
                                     <h3>Last graph.</h3>

                                    </div>
A few others
                              <div id=“container”>
h3 + p { color:orange; }
                               <h3>Here is one headline</h3>

                               <div>
                                <h3>Another</h3>
                                <p>Some text here</p>
                               </div>

                               <p>Another paragraph.</p>
                               <h3>Last graph.</h3>

                              </div>
A few others
                                  <div id=“container”>
h3:first-child { color:orange; }
                                   <h3>Here is one headline</h3>

                                   <div>
                                    <h3>Another</h3>
                                    <p>Some text here</p>
                                   </div>

                                   <p>Another paragraph.</p>
                                   <h3>Last graph.</h3>

                                  </div>
The Cascade
What happens if there is a conflict?
External Style Sheet    Embedded Style Sheet           Inline Styles

                            <head>
                             <style>

                               .headlines {
                                                <div style= “color:black;”>
                                 color:black;
                               }

                              </style>
                            </head>




                The more specific rules take precedence.
Which rule wins out?
#container {                 <div id="container">

    font-size: 30px;          <div id="headline">
}                              <p>My headline</p>
#headline {
                              </div>
    font-size: 10px;
                             </div>
}
Which rule wins out?
#container {                               <div id="container">

    font-size: 30px;                           <div id="headline">
}                                               <p>My headline</p>
#container {
                                               </div>
    font-size: 10px;
                                           </div>
}                      Because it comes last
Cascade Recap
Stylesheet Order       Last Rule              Inheritance

1. External            Rules that come last   Specificity
2. Embedded (<head>)

3. Inline
Properties
Text Color
                color:	
  #ee3e80;

COLOR NAMES      RGB VALUES          Hexadecimal

147 predefined    Values for red,     Six or three digit
names            green and blue      alpha-numeral.

DarkCyan         rgb(100,100,90);    #FFFFFF;
Purple           rgb(255,255,255);   #000000;
Black            rgb(0,0,0);         #000;
Red              rgb(30,44,200);     #AF0;
Backgrounds
background-­‐color:	
  #ee3e80;

 background-­‐image:url(‘image.jpg’);
 background-­‐position:0px	
  50%;
 background-­‐repeat:repeat;

Short code
background:	
  url(‘path_to_image.jpg’)	
  no-­‐repeat	
  0px	
  0px;
Font Family
 font-­‐family:	
  Helvetica,	
  Arial,	
  san-­‐serif;

FALL BACK             QUOTES               END WITH
                                           GENERIC
A comma               Use quotes when
separated list of     a font is multiple   End with a
fonts to use if the   words, like          generic font, like
system doesnʼt        “Times New           serif or san-serif.
have the font         Roman.”              This way the
installed.                                 browser will pick
                                           for you.
Font Size
                    font-­‐size:	
  12px;

PIXELS                PERCENTAGES           EM

Pixels are            Percentages are       EM is another
considered a          relative from the     way of doing
fixed font size.       default size of the   relative
Fonts will appear     text. 100%            measurement.
at this size          means the default     Varies only
relative to the       size.                 slightly from %.
screen size.
Others
font-­‐weight:	
  normal;   line-­‐height:	
  1em;
font-­‐weight:	
  bold;     line-­‐height:	
  1.4em;
font-­‐style:	
  normal;    letter-­‐spacing:	
  1em;
font-­‐style:	
  italic;    word-­‐spacing:	
  1em;
font-­‐style:	
  oblique;   text-­‐decoration:none;

text-­‐transform:	
  uppercase;  text-­‐align:	
  left;
text-­‐transform:	
  lowercase;  text-­‐align:	
  right;
text-­‐transform:	
  capitalize; text-­‐aling:	
  center
Links
a:link      a:link              a:visited
a:visited
            Before a user       After a user clicks
a:hover     clicks on a link.   on a link.
a:active

            a:hover             a:active

            When a user         When the user
            hovers over a       clicks down on a
            link.               link.
Border, Margin and Padding
margin-­‐top:10px;
margin-­‐right:10px;
margin-­‐bottom:10px;
margin-­‐left:10px;
                                       hello
                              Margin    Border   Padding


margin:5px	
  10px	
  6px	
  5px;       Width
borders
border-­‐color
border-­‐width             Single sides

                 border-­‐top-­‐color:#ffffff;
border-­‐style   border-­‐left-­‐width:	
  20px;

solid
dotted                      Combined
dashed           border:1px	
  solid	
  #000000;
groove
...
Inline vs Block
                               Inline                                                                 block

                                                                     Lorem ipsum dolor sit amet, consectetur adipisicing elit,
                                                                     sed do eiusmod tempor incididunt ut labore et dolore
                                                                     magna aliqua.

                           Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad
                                                          <img>      List of the best pies                                       <p>
minim veniam, quis nostrud exercitation ullamco laboris   <span>      • Apple                                                    <div>
nisi ut aliquip ex ea commodo consequat. Duis aute                    • Cherry
irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur
                                                          <strong>    • Pumpkin                                                  <li>
sint occaecat cupidatat non proident, sunt in culpa qui
officia deserunt mollit anim id est laborum.
                                                          <em>                                                                   <h1>
Inline vs Block
display:inline;
display:block;
display:none;

display:block;        display:inline;

• Apple
• Cherry             • Apple • Cherry • Pumpkin
• Pumpkin
Visibility
visibility:visible;    visibility:hidden;



     Hi Mom!
CSS Reset
CSS Reset
html,	
  body,	
  div,	
  span,	
  applet,	
  object,	
  iframe,	
  h1,	
  h2,	
  h3,	
  h4,	
  h5,	
  h6,	
  
p,	
  blockquote,	
  pre,	
  a,	
  abbr,	
  acronym,	
  address,	
  big,	
  cite,	
  code,	
  del,	
  
dfn,	
  em,	
  img,	
  ins,	
  kbd,	
  q,	
  s,	
  samp,	
  small,	
  strike,	
  strong,	
  sub,	
  sup,	
  
tt,	
  var,	
  b,	
  u,	
  i,	
  center,	
  dl,	
  dt,	
  dd,	
  ol,	
  ul,	
  li,	
  fieldset,	
  form,	
  
label,	
  legend,	
  table,	
  caption,	
  tbody,	
  tfoot,	
  thead,	
  tr,	
  th,	
  td,	
  
article,	
  aside,	
  canvas,	
  details,	
  embed,	
  figure,	
  figcaption,	
  footer,	
  
header,	
  hgroup,	
  menu,	
  nav,	
  output,	
  ruby,	
  section,	
  summary,	
  time,	
  mark,	
  
audio,	
  video	
  {
	
   margin:	
  0;
	
   padding:	
  0;
	
   border:	
  0;
	
   font-­‐size:	
  100%;
	
   font:	
  inherit;
	
   vertical-­‐align:	
  baseline;
}

More Related Content

Viewers also liked

CSS - chained classes
CSS - chained classesCSS - chained classes
CSS - chained classes
Emmanuel Ide
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
Singsys Pte Ltd
 
Understanding DIVs
Understanding DIVsUnderstanding DIVs
Inline, Block and Positioning in CSS
Inline, Block and Positioning in CSSInline, Block and Positioning in CSS
Inline, Block and Positioning in CSS
UC Berkeley Graduate School of Journalism
 
Event handling63
Event handling63Event handling63
Event handling63myrajendra
 
13. session 13 introduction to dhtml
13. session 13   introduction to dhtml13. session 13   introduction to dhtml
13. session 13 introduction to dhtmlPhúc Đỗ
 
Dynamic HTML Event Model
Dynamic HTML Event ModelDynamic HTML Event Model
Dynamic HTML Event Model
Reem Alattas
 
Dhtml
DhtmlDhtml
Open Source and Open Data in the Age of the Cloud
Open Source and Open Data in the Age of the CloudOpen Source and Open Data in the Age of the Cloud
Open Source and Open Data in the Age of the Cloud
Tim O'Reilly
 
Css Positioning Elements
Css Positioning ElementsCss Positioning Elements
Css Positioning Elementssanjay2211
 
Estandares y UTF-8 Matrimonio perfecto para aplicaciones multilingues
Estandares y UTF-8 Matrimonio perfecto para aplicaciones multilinguesEstandares y UTF-8 Matrimonio perfecto para aplicaciones multilingues
Estandares y UTF-8 Matrimonio perfecto para aplicaciones multilingues
ketari
 
Tutorial css
Tutorial cssTutorial css
Tutorial css
Juanjo Bote
 
Groopify para groopies
Groopify para groopiesGroopify para groopies
Groopify para groopies
Groopify
 
Clase 07 04 08
Clase 07 04 08Clase 07 04 08
Clase 07 04 08farohache
 
"Primeros pasos en una start up" por @yusefmartins
"Primeros pasos en una start up" por @yusefmartins"Primeros pasos en una start up" por @yusefmartins
"Primeros pasos en una start up" por @yusefmartins
webcat
 

Viewers also liked (20)

CSS - chained classes
CSS - chained classesCSS - chained classes
CSS - chained classes
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
 
Understanding DIVs
Understanding DIVsUnderstanding DIVs
Understanding DIVs
 
Inline, Block and Positioning in CSS
Inline, Block and Positioning in CSSInline, Block and Positioning in CSS
Inline, Block and Positioning in CSS
 
Jquery plugins
Jquery pluginsJquery plugins
Jquery plugins
 
Event handling63
Event handling63Event handling63
Event handling63
 
13. session 13 introduction to dhtml
13. session 13   introduction to dhtml13. session 13   introduction to dhtml
13. session 13 introduction to dhtml
 
Unit 6 Java
Unit 6 JavaUnit 6 Java
Unit 6 Java
 
Dynamic HTML Event Model
Dynamic HTML Event ModelDynamic HTML Event Model
Dynamic HTML Event Model
 
Dhtml
DhtmlDhtml
Dhtml
 
Open Source and Open Data in the Age of the Cloud
Open Source and Open Data in the Age of the CloudOpen Source and Open Data in the Age of the Cloud
Open Source and Open Data in the Age of the Cloud
 
Css Positioning Elements
Css Positioning ElementsCss Positioning Elements
Css Positioning Elements
 
CSS tutorial
CSS tutorialCSS tutorial
CSS tutorial
 
Css advance
Css   advanceCss   advance
Css advance
 
Estandares y UTF-8 Matrimonio perfecto para aplicaciones multilingues
Estandares y UTF-8 Matrimonio perfecto para aplicaciones multilinguesEstandares y UTF-8 Matrimonio perfecto para aplicaciones multilingues
Estandares y UTF-8 Matrimonio perfecto para aplicaciones multilingues
 
Estilos cascadas
Estilos cascadasEstilos cascadas
Estilos cascadas
 
Tutorial css
Tutorial cssTutorial css
Tutorial css
 
Groopify para groopies
Groopify para groopiesGroopify para groopies
Groopify para groopies
 
Clase 07 04 08
Clase 07 04 08Clase 07 04 08
Clase 07 04 08
 
"Primeros pasos en una start up" por @yusefmartins
"Primeros pasos en una start up" por @yusefmartins"Primeros pasos en una start up" por @yusefmartins
"Primeros pasos en una start up" por @yusefmartins
 

Similar to CSS Tutorial

Div Tag Tutorial
Div Tag TutorialDiv Tag Tutorial
Div Tag Tutorialbav123
 
Css for Development
Css for DevelopmentCss for Development
Css for Developmenttsengsite
 
ACSS: Rethinking CSS Best Practices
ACSS: Rethinking CSS Best PracticesACSS: Rethinking CSS Best Practices
ACSS: Rethinking CSS Best Practices
Renato Iwashima
 
モダンなCSS設計パターンを考える
モダンなCSS設計パターンを考えるモダンなCSS設計パターンを考える
モダンなCSS設計パターンを考える
拓樹 谷
 
What is HTML5?
What is HTML5?What is HTML5?
What is HTML5?
Anas AbuDayah
 
RSS: the duct tape of web2.0
RSS: the duct tape of web2.0RSS: the duct tape of web2.0
RSS: the duct tape of web2.0
Rob Clark
 

Similar to CSS Tutorial (6)

Div Tag Tutorial
Div Tag TutorialDiv Tag Tutorial
Div Tag Tutorial
 
Css for Development
Css for DevelopmentCss for Development
Css for Development
 
ACSS: Rethinking CSS Best Practices
ACSS: Rethinking CSS Best PracticesACSS: Rethinking CSS Best Practices
ACSS: Rethinking CSS Best Practices
 
モダンなCSS設計パターンを考える
モダンなCSS設計パターンを考えるモダンなCSS設計パターンを考える
モダンなCSS設計パターンを考える
 
What is HTML5?
What is HTML5?What is HTML5?
What is HTML5?
 
RSS: the duct tape of web2.0
RSS: the duct tape of web2.0RSS: the duct tape of web2.0
RSS: the duct tape of web2.0
 

More from UC Berkeley Graduate School of Journalism

Jquery News Packages
Jquery News PackagesJquery News Packages
The 960 Grid System
The 960 Grid SystemThe 960 Grid System
Intro to CSS
Intro to CSSIntro to CSS
Intro to HTML
Intro to HTMLIntro to HTML

More from UC Berkeley Graduate School of Journalism (6)

Jquery News Packages
Jquery News PackagesJquery News Packages
Jquery News Packages
 
HTML News Packages Lesson
HTML News Packages LessonHTML News Packages Lesson
HTML News Packages Lesson
 
Quiz
QuizQuiz
Quiz
 
The 960 Grid System
The 960 Grid SystemThe 960 Grid System
The 960 Grid System
 
Intro to CSS
Intro to CSSIntro to CSS
Intro to CSS
 
Intro to HTML
Intro to HTMLIntro to HTML
Intro to HTML
 

Recently uploaded

DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
ArianaBusciglio
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 

Recently uploaded (20)

DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 

CSS Tutorial

  • 2. Parts of a CSS rule h2 { color: #000000; }
  • 3. Parts of a CSS rule h2 { color: #000000; } SELECTOR
  • 4. Parts of a CSS rule h2 { color: #000000; } CURLY BRACKETS
  • 5. Parts of a CSS rule h2 { color: #000000; } PROPERTY
  • 6. Parts of a CSS rule h2 { color: #000000; } VALUE
  • 7. Parts of a CSS rule h2 { color: #000000; } START WITH SELECTOR
  • 8. Three Kinds of Selectors TYPE SELECTORS CLASS SELECTORS ID SELECTORS div .headlines #container p .paragraphs #first-­‐article h2 .bylines #footer strong .summary #sidebar
  • 9. Type Selectors <body> h2 { <div id=“container”> <h2 class=“headline”>Hello World</h2> font-style: bold; <p class=“byline”>By Jeremy Rue.</p> } <p>In todayʼs news, a class at UC Berkeley learned the importance of CSS in designing and building webpages.</p> p{ <div id=“sidebar”> <h2>Side Bar Story</h2> <p class=“byline”>By John Doe.</p> font-family: Helvetica; <p>This is a related story.</p> </div> } </div> </body>
  • 10. Type Selectors <body> h2 { <div id=“container”> <h2 class=“headline”>Hello World</h2> font-style: bold; <p class=“byline”>By Jeremy Rue.</p> } <p>In todayʼs news, a class at UC Berkeley learned the importance of CSS in designing and building webpages.</p> p{ <div id=“sidebar”> <h2>Side Bar Story</h2> <p class=“byline”>By John Doe.</p> font-family: Helvetica; <p>This is a related story.</p> </div> } </div> </body>
  • 11. Class Selectors <body> .headline { <div id=“container”> <h2 class=“headline”>Hello World</h2> text-decoration: underline; <p class=“byline”>By Jeremy Rue.</p> } <p>In todayʼs news, a class at UC Berkeley learned the importance of CSS in designing and building webpages.</p> .byline { <div id=“sidebar”> <h2>Side Bar Story</h2> <p class=“byline”>By John Doe.</p> font-size: 8px; <p>This is a related story.</p> </div> } </div> </body>
  • 12. Class Selectors <body> .headline { <div id=“container”> <h2 class=“headline”>Hello World</h2> text-decoration: underline; <p class=“byline”>By Jeremy Rue.</p> } <p>In todayʼs news, a class at UC Berkeley learned the importance of CSS in designing and building webpages.</p> .byline { <div id=“sidebar”> <h2>Side Bar Story</h2> <p class=“byline”>By John Doe.</p> font-size: 8px; <p>This is a related story.</p> </div> } </div> </body>
  • 13. ID Selectors <body> #container { <div id=“container”> <h2 class=“headline”>Hello World</h2> font-size: 30px; <p class=“byline”>By Jeremy Rue.</p> } <p>In todayʼs news, a class at UC Berkeley learned the importance of CSS in designing and building webpages.</p> #sidebar { <div id=“sidebar”> <h2>Side Bar Story</h2> <p class=“byline”>By John Doe.</p> font-size: 8px; <p>This is a related story.</p> </div> } </div> </body>
  • 14. ID Selectors <body> #container { <div id=“container”> <h2 class=“headline”>Hello World</h2> font-size: 30px; <p class=“byline”>By Jeremy Rue.</p> } <p>In todayʼs news, a class at UC Berkeley learned the importance of CSS in designing and building webpages.</p> #sidebar { <div id=“sidebar”> <h2>Side Bar Story</h2> <p class=“byline”>By John Doe.</p> font-size: 8px; <p>This is a related story.</p> </div> } </div> </body>
  • 15. More ways to use selectors
  • 16. More Selector Options <body> .headline{ <div id=“container”> <h2 class=“headline”>Hello World</h2> font-size: 30px; <p class=“byline”>By Jeremy Rue.</p> } <p>In todayʼs news, a class at UC Berkeley learned the importance of CSS in designing and building webpages.</p> <div id=“sidebar”> <h3 class=“headline”>Side Bar Story</h3> <p class=“byline”>By John Doe.</p> <p>This is a related story.</p> </div> </div> </body>
  • 17. More Selector Options <body> h2.headline { <div id=“container”> <h2 class=“headline”>Hello World</h2> font-size: 30px; <p class=“byline”>By Jeremy Rue.</p> } <p>In todayʼs news, a class at UC Berkeley learned the importance of CSS in designing and building webpages.</p> <div id=“sidebar”> <h3 class=“headline”>Side Bar Story</h3> <p class=“byline”>By John Doe.</p> <p>This is a related story.</p> </div> </div> </body>
  • 18. More Selector Options <body> #sidebar p { <div id=“container”> <h2 class=“headline”>Hello World</h2> font-size: 30px; <p class=“byline”>By Jeremy Rue.</p> } <p>In todayʼs news, a class at UC Berkeley learned the importance of CSS in designing and building webpages.</p> A space means <div id=“sidebar”> descendant. <h3 class=“headline”>Side Bar Story</h3> <p class=“byline”>By John Doe.</p> <p>This is a related story.</p> </div> </div> </body>
  • 19. More Selector Options <body> #container #sidebar h3 { <div id=“container”> <h2 class=“headline”>Hello World</h2> font-size: 30px; <p class=“byline”>By Jeremy Rue.</p> } <p>In todayʼs news, a class at UC Berkeley learned the importance of CSS in designing and building webpages.</p> <div id=“sidebar”> <h3 class=“headline”>Side Bar Story</h3> <p class=“byline”>By John Doe.</p> <p>This is a related story.</p> </div> </div> </body>
  • 20. More Selector Options <body> #container #sidebar h3 { <div id=“container”> <h2 class=“headline”>Hello World</h2> font-size: 30px; <p class=“byline”>By Jeremy Rue.</p> } <p>In todayʼs news, a class at UC Berkeley learned the importance of CSS in designing and building webpages.</p> <div id=“sidebar”> <h3 class=“headline”>Side Bar Story</h3> <p class=“byline”>By John Doe.</p> <p>This is a related story.</p> </div> </div> </body>
  • 21. More Selector Options <body> #container #sidebar h3 { <div id=“container”> <h2 class=“headline”>Hello World</h2> font-size: 30px; <p class=“byline”>By Jeremy Rue.</p> } <p>In todayʼs news, a class at UC Berkeley learned the importance of CSS in designing and building webpages.</p> <div id=“sidebar”> <h3 class=“headline”>Side Bar Story</h3> <p class=“byline”>By John Doe.</p> <p>This is a related story.</p> </div> </div> </body>
  • 22. More Selector Options <body> #container #sidebar h3 { <div id=“container”> <h2 class=“headline”>Hello World</h2> font-size: 30px; <p class=“byline”>By Jeremy Rue.</p> } <p>In todayʼs news, a class at UC Berkeley learned the importance of CSS in designing and building webpages.</p> <div id=“sidebar”> <h3 class=“headline”>Side Bar Story</h3> <p class=“byline”>By John Doe.</p> <p>This is a related story.</p> </div> </div> </body>
  • 23. NOT to be confused with...
  • 24. HTML vs CSS HTML CSS <div class=“headline lead-story article”> .headline p { } These spaces give multiple classes This space means a <p> tag inside another tag with class .headline
  • 25. Example from Richmond Site <div id="post-38661" class="hentry p1 post publish author-lexi- pandell category-education category-featured category-front tag-big-brother-big-sister tag-mentoring tag-nonprofit tag- youth y2012 m02 d07 h13">
  • 26. A few others <div id=“container”> h3, p { color:orange; } <h3>Here is one headline</h3> <div> <h3>Another</h3> <p>Some text here</p> </div> <p>Another paragraph.</p> <h3>Last graph.</h3> </div>
  • 27. A few others <div id=“container”> #container > h3 { color:orange; } <h3>Here is one headline</h3> <div> <h3>Another</h3> <p>Some text here</p> </div> <p>Another paragraph.</p> <h3>Last graph.</h3> </div>
  • 28. A few others <div id=“container”> h3 + p { color:orange; } <h3>Here is one headline</h3> <div> <h3>Another</h3> <p>Some text here</p> </div> <p>Another paragraph.</p> <h3>Last graph.</h3> </div>
  • 29. A few others <div id=“container”> h3:first-child { color:orange; } <h3>Here is one headline</h3> <div> <h3>Another</h3> <p>Some text here</p> </div> <p>Another paragraph.</p> <h3>Last graph.</h3> </div>
  • 31. What happens if there is a conflict? External Style Sheet Embedded Style Sheet Inline Styles <head> <style> .headlines { <div style= “color:black;”> color:black; } </style> </head> The more specific rules take precedence.
  • 32. Which rule wins out? #container { <div id="container"> font-size: 30px; <div id="headline"> } <p>My headline</p> #headline { </div> font-size: 10px; </div> }
  • 33. Which rule wins out? #container { <div id="container"> font-size: 30px; <div id="headline"> } <p>My headline</p> #container { </div> font-size: 10px; </div> } Because it comes last
  • 34. Cascade Recap Stylesheet Order Last Rule Inheritance 1. External Rules that come last Specificity 2. Embedded (<head>) 3. Inline
  • 36. Text Color color:  #ee3e80; COLOR NAMES RGB VALUES Hexadecimal 147 predefined Values for red, Six or three digit names green and blue alpha-numeral. DarkCyan rgb(100,100,90); #FFFFFF; Purple rgb(255,255,255); #000000; Black rgb(0,0,0); #000; Red rgb(30,44,200); #AF0;
  • 37. Backgrounds background-­‐color:  #ee3e80; background-­‐image:url(‘image.jpg’); background-­‐position:0px  50%; background-­‐repeat:repeat; Short code background:  url(‘path_to_image.jpg’)  no-­‐repeat  0px  0px;
  • 38. Font Family font-­‐family:  Helvetica,  Arial,  san-­‐serif; FALL BACK QUOTES END WITH GENERIC A comma Use quotes when separated list of a font is multiple End with a fonts to use if the words, like generic font, like system doesnʼt “Times New serif or san-serif. have the font Roman.” This way the installed. browser will pick for you.
  • 39. Font Size font-­‐size:  12px; PIXELS PERCENTAGES EM Pixels are Percentages are EM is another considered a relative from the way of doing fixed font size. default size of the relative Fonts will appear text. 100% measurement. at this size means the default Varies only relative to the size. slightly from %. screen size.
  • 40. Others font-­‐weight:  normal; line-­‐height:  1em; font-­‐weight:  bold; line-­‐height:  1.4em; font-­‐style:  normal; letter-­‐spacing:  1em; font-­‐style:  italic; word-­‐spacing:  1em; font-­‐style:  oblique; text-­‐decoration:none; text-­‐transform:  uppercase; text-­‐align:  left; text-­‐transform:  lowercase; text-­‐align:  right; text-­‐transform:  capitalize; text-­‐aling:  center
  • 41. Links a:link a:link a:visited a:visited Before a user After a user clicks a:hover clicks on a link. on a link. a:active a:hover a:active When a user When the user hovers over a clicks down on a link. link.
  • 42. Border, Margin and Padding margin-­‐top:10px; margin-­‐right:10px; margin-­‐bottom:10px; margin-­‐left:10px; hello Margin Border Padding margin:5px  10px  6px  5px; Width
  • 43. borders border-­‐color border-­‐width Single sides border-­‐top-­‐color:#ffffff; border-­‐style border-­‐left-­‐width:  20px; solid dotted Combined dashed border:1px  solid  #000000; groove ...
  • 44. Inline vs Block Inline block Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad <img> List of the best pies <p> minim veniam, quis nostrud exercitation ullamco laboris <span> • Apple <div> nisi ut aliquip ex ea commodo consequat. Duis aute • Cherry irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur <strong> • Pumpkin <li> sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. <em> <h1>
  • 45. Inline vs Block display:inline; display:block; display:none; display:block; display:inline; • Apple • Cherry • Apple • Cherry • Pumpkin • Pumpkin
  • 46. Visibility visibility:visible; visibility:hidden; Hi Mom!
  • 48. CSS Reset html,  body,  div,  span,  applet,  object,  iframe,  h1,  h2,  h3,  h4,  h5,  h6,   p,  blockquote,  pre,  a,  abbr,  acronym,  address,  big,  cite,  code,  del,   dfn,  em,  img,  ins,  kbd,  q,  s,  samp,  small,  strike,  strong,  sub,  sup,   tt,  var,  b,  u,  i,  center,  dl,  dt,  dd,  ol,  ul,  li,  fieldset,  form,   label,  legend,  table,  caption,  tbody,  tfoot,  thead,  tr,  th,  td,   article,  aside,  canvas,  details,  embed,  figure,  figcaption,  footer,   header,  hgroup,  menu,  nav,  output,  ruby,  section,  summary,  time,  mark,   audio,  video  {   margin:  0;   padding:  0;   border:  0;   font-­‐size:  100%;   font:  inherit;   vertical-­‐align:  baseline; }