SlideShare a Scribd company logo
1 of 50
AN INTRODUCTION
                 TO CSS 2.1 & CSS 3



AN INTRODUCTION TO CSS 2.1 & CSS 3   MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
A Few Questions
                                     Itā€™s hand-raising time


      ā€¢ How many of you are designers?




AN INTRODUCTION TO CSS 2.1 & CSS 3                 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
A Few Questions
                                     Itā€™s hand-raising time


      ā€¢ How many of you are designers?
      ā€¢ How many of you are front-end developers?




AN INTRODUCTION TO CSS 2.1 & CSS 3                 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
A Few Questions
                                     Itā€™s hand-raising time


      ā€¢ How many of you are designers?
      ā€¢ How many of you are front-end developers?
      ā€¢ How many of you are back-end developers?




AN INTRODUCTION TO CSS 2.1 & CSS 3                 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
A Few Questions
                                     Itā€™s hand-raising time


      ā€¢ How many of you are designers?
      ā€¢ How many of you are front-end developers?
      ā€¢ How many of you are back-end developers?
      ā€¢ How many of you are all of the above?




AN INTRODUCTION TO CSS 2.1 & CSS 3                 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
A Few Questions
                                     Itā€™s hand-raising time


      ā€¢ How many of you are designers?
      ā€¢ How many of you are front-end developers?
      ā€¢ How many of you are back-end developers?
      ā€¢ How many of you are all of the above?
      ā€¢ How many of you are none of the above?




AN INTRODUCTION TO CSS 2.1 & CSS 3                 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
A Few Questions
                                     Itā€™s hand-raising time


      ā€¢ How many of you are designers?
      ā€¢ How many of you are front-end developers?
      ā€¢ How many of you are back-end developers?
      ā€¢ How many of you are all of the above?
      ā€¢ How many of you are none of the above?
      ā€¢ How many of you hate raising your hand?


AN INTRODUCTION TO CSS 2.1 & CSS 3                 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Disclaimer(s)
                      Setting expectations & protecting my butt


       ā€¢ This is an introduction to CSS 2.1 and CSS 3




AN INTRODUCTION TO CSS 2.1 & CSS 3           MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Disclaimer(s)
                      Setting expectations & protecting my butt


       ā€¢ This is an introduction to CSS 2.1 and CSS 3
       ā€¢ CSS 2.1 and CSS 3 are not fully supported




AN INTRODUCTION TO CSS 2.1 & CSS 3           MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Disclaimer(s)
                      Setting expectations & protecting my butt


       ā€¢ This is an introduction to CSS 2.1 and CSS 3
       ā€¢ CSS 2.1 and CSS 3 are not fully supported
       ā€¢ Nearly everything youā€™ll see will not work in
         Internet Explorer 6




AN INTRODUCTION TO CSS 2.1 & CSS 3           MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Disclaimer(s)
                      Setting expectations & protecting my butt


       ā€¢ This is an introduction to CSS 2.1 and CSS 3
       ā€¢ CSS 2.1 and CSS 3 are not fully supported
       ā€¢ Nearly everything youā€™ll see will not work in
         Internet Explorer 6
       ā€¢ We donā€™t like Internet Explorer 6




AN INTRODUCTION TO CSS 2.1 & CSS 3           MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Disclaimer(s)
                      Setting expectations & protecting my butt


       ā€¢ This is an introduction to CSS 2.1 and CSS 3
       ā€¢ CSS 2.1 and CSS 3 are not fully supported
       ā€¢ Nearly everything youā€™ll see will not work in
         Internet Explorer 6
       ā€¢ We donā€™t like Internet Explorer 6
       ā€¢ Or 7



AN INTRODUCTION TO CSS 2.1 & CSS 3           MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Disclaimer(s)
                      Setting expectations & protecting my butt


       ā€¢ This is an introduction to CSS 2.1 and CSS 3
       ā€¢ CSS 2.1 and CSS 3 are not fully supported
       ā€¢ Nearly everything youā€™ll see will not work in
         Internet Explorer 6
       ā€¢ We donā€™t like Internet Explorer 6
       ā€¢ Or 7
       ā€¢ 8 is OK

AN INTRODUCTION TO CSS 2.1 & CSS 3           MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
The History of CSS
                        The new stuff is old & itā€™s out of order

       ā€¢ CSS 1 became a W3C recommendation in
         December of 1996 http://www.w3.org/TR/CSS1/




AN INTRODUCTION TO CSS 2.1 & CSS 3             MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
The History of CSS
                        The new stuff is old & itā€™s out of order

       ā€¢ CSS 1 became a W3C recommendation in
         December of 1996 http://www.w3.org/TR/CSS1/
       ā€¢ CSS 2 became a W3C recommendation in
         May of 1998 http://www.w3.org/TR/2008/REC-CSS2-20080411/




AN INTRODUCTION TO CSS 2.1 & CSS 3             MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
The History of CSS
                        The new stuff is old & itā€™s out of order

       ā€¢ CSS 1 became a W3C recommendation in
         December of 1996 http://www.w3.org/TR/CSS1/
       ā€¢ CSS 2 became a W3C recommendation in
         May of 1998 http://www.w3.org/TR/2008/REC-CSS2-20080411/
       ā€¢ CSS 3 became a W3C working draft in April
         of 2000 http://www.w3.org/TR/2000/WD-css3-selectors-20000410




AN INTRODUCTION TO CSS 2.1 & CSS 3             MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
The History of CSS
                        The new stuff is old & itā€™s out of order

       ā€¢ CSS 1 became a W3C recommendation in
         December of 1996 http://www.w3.org/TR/CSS1/
       ā€¢ CSS 2 became a W3C recommendation in
         May of 1998 http://www.w3.org/TR/2008/REC-CSS2-20080411/
       ā€¢ CSS 3 became a W3C working draft in April
         of 2000 http://www.w3.org/TR/2000/WD-css3-selectors-20000410
       ā€¢ CSS 2.1 became a W3C working draft in
         August of 2002 http://www.w3.org/TR/2002/WD-
           CSS21-20020802/



AN INTRODUCTION TO CSS 2.1 & CSS 3             MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Lets See Some Examples
                         Weā€™ll see examples of CSS that will...


       1. Improve element and content targeting




AN INTRODUCTION TO CSS 2.1 & CSS 3             MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Lets See Some Examples
                         Weā€™ll see examples of CSS that will...


       1. Improve element and content targeting
       2. Replace outdated techniques for achieving
          certain design trends (lets stop making
          rounded corners and drop-shadows with
          images, eh?)




AN INTRODUCTION TO CSS 2.1 & CSS 3             MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Lets See Some Examples
                         Weā€™ll see examples of CSS that will...


       1. Improve element and content targeting
       2. Replace outdated techniques for achieving
          certain design trends (lets stop making
          rounded corners and drop-shadows with
          images, eh?)
       3. Replace some actions and behaviors
          currently found in JavaScript



AN INTRODUCTION TO CSS 2.1 & CSS 3             MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Lets See Some Examples
                         Weā€™ll see examples of CSS that will...


       1. Improve element and content targeting
       2. Replace outdated techniques for achieving
          certain design trends (lets stop making
          rounded corners and drop-shadows with
          images, eh?)
       3. Replace some actions and behaviors
          currently found in JavaScript



AN INTRODUCTION TO CSS 2.1 & CSS 3             MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Child Selector >
                 Select any element thatā€™s a child of another element

#childSelector > p {                            This content is targeted.
	 color: red;
                                                ā€¢ This content is NOT targeted
}
                                                ā€¢ This content is NOT targeted

                                                   This content is NOT targeted.

<div id="childSelector">                        This content is targeted.
	 <p>This content is targeted.</p>
                                                This content is targeted.
	 <ul>
	 	    <li>This content is NOT targeted.</li>
	 	    <li>This content is NOT targeted.</li>
	 </ul>
	 <blockquote>
	 	    <p>This content is NOT targeted.</p>        7         8
	 </blockquote>
	 <p>This content is targeted.</p>
	 <p>This content is targeted.</p>
                                                   2         3         3.5
</div>
                                                    3        3.1            4
                                                   9



AN INTRODUCTION TO CSS 2.1 & CSS 3              MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Adjacent Sibling Selector +
            Select an element thatā€™s a direct sibling of another element

blockquote + p {                                     This content is NOT targeted.
	 color: red;
                                                         This content is inside of a blockquote.
}
                                                     This content is targeted.

                                                     This content is NOT targeted.
<p>This content is NOT targeted.</p>
<blockquote>
    <p>This content is inside of a blockquote.</p>
</blockquote>
<p>This content is targeted.</p>
<p>This content is NOT targeted.</p>

                                                        7         8
                                                        2         3         3.5
                                                        3         3.1            4
                                                        9



AN INTRODUCTION TO CSS 2.1 & CSS 3                   MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
General Sibling Selector ~
                   Select an element thatā€™s a sibling of another element

blockquote ~ p {                                     This content is NOT targeted.
	 color: red;
                                                         This content is inside of a blockquote.
}
                                                     This content is targeted.

                                                     This content is targeted.
<p>This content is NOT targeted.</p>
                                                     This content is NOT targeted.
<blockquote>
    <p>This content is inside of a blockquote.</p>   This content is targeted.
</blockquote>
<p>This content is targeted.</p>
<p>This content is targeted.</p>
<div>
	 <p>This content is NOT targeted.</p>                  7         8
</div>
<p>This content is targeted.</p>
                                                        2         3         3.5
                                                        3         3.1            4
                                                        9



AN INTRODUCTION TO CSS 2.1 & CSS 3                   MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Attribute Selector [name=value]
             Select an element that has a particular attribute & value

input[type=text] {
	 border-color: red;
}




<input type="password" name="one" />
<input type="text" name="two" />


                                               7      8
                                               2      3      3.5
                                               3      3.1      4
                                               9



AN INTRODUCTION TO CSS 2.1 & CSS 3          MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
First Child Pseudo-class :first-child
          Select only the first child element among many of its siblings

ul li:first-child {                             ā€¢   This   content   is   targeted
	 color: red;                                   ā€¢   This   content   is   NOT targeted
}                                               ā€¢   This   content   is   NOT targeted
                                                ā€¢   This   content   is   NOT targeted
                                                ā€¢   This   content   is   NOT targeted

<ul>
	 <li>This   content   is   targeted</li>
	 <li>This   content   is   NOT targeted</li>
	 <li>This   content   is   NOT targeted</li>
	 <li>This   content   is   NOT targeted</li>
	 <li>This   content   is   NOT targeted</li>
</ul>
                                                     7          8
                                                     2           3            3.5
                                                     3           3.1             4
                                                     9



AN INTRODUCTION TO CSS 2.1 & CSS 3              MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Last Child Pseudo-class :last-child
           Select only the last child element among many of its siblings

ul li:last-child {                              ā€¢   This   content   is   NOT targeted
	 color: red;                                   ā€¢   This   content   is   NOT targeted
}                                               ā€¢   This   content   is   NOT targeted
                                                ā€¢   This   content   is   NOT targeted
                                                ā€¢   This   content   is   targeted

<ul>
	 <li>This   content   is   NOT targeted</li>
	 <li>This   content   is   NOT targeted</li>
	 <li>This   content   is   NOT targeted</li>
	 <li>This   content   is   NOT targeted</li>
	 <li>This   content   is   targeted</li>
</ul>
                                                     7          8
                                                     2           3            3.5
                                                     3           3.1             4
                                                     9



AN INTRODUCTION TO CSS 2.1 & CSS 3              MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
First Letter Pseudo-element :first-letter
                           Select the first letter in any element

p:first-letter {
	 color: red;                                    The ļ¬rst letter in this paragraph is targeted.
	 font-size: 2em;
}



<p>The first letter in this paragraph is
targeted.</p>




                                                    7         8
                                                    2         3         3.5
                                                    3         3.1          4
                                                    9



AN INTRODUCTION TO CSS 2.1 & CSS 3               MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
First Line Pseudo-element :first-line
                 Dynamically select the first line of text in any element

p:first-line {                                   The ļ¬rst line of this paragraph is targeted. Resize your
	 color: red;                                    browser window and watch how, regardless of where
}                                                words move, only those words found in the ļ¬rst line
                                                 remain targeted. This is just some ļ¬ller content to make
                                                 the paragraph larger. This is just some ļ¬ller content to
                                                 make the paragraph larger. This is just some ļ¬ller
                                                 content to make the paragraph larger.
<p>The first line of this paragraph is
targeted. Resize your browser window and watch
how, regardless of where words move, only
those words found in the first line remain
targeted. This is just some filler content to
make the paragraph larger. This is just some
filler content to make the paragraph larger.
This is just some filler content to make the        7         8
paragraph larger.</p>
                                                    2         3        3.5
                                                    3         3.1          4
                                                    9



AN INTRODUCTION TO CSS 2.1 & CSS 3               MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Enabled, Disabled, & Checked Pseudo-classes
        :enabled, :disabled, :checked
           Change the appearance of form inputs based on their status

:enabled {                                      This input is enabled
	 border-color: green;
}
                                                This input is disabled
:disabled {
	 border-color: red;
                                                         This checkbox is initially checked
}
:checked {
	 margin-left: 50px;
}
                                                   7         8
<input type="text" value="This input is
enabled" />                                        2         3           3.5
<input type="text" disabled="disabled"
value="This input is disabled" />
<label>                                            3         3.1          4
	 <input type="checkbox" checked="checked" />
    This checkbox is initially checked
</label>
                                                   9



AN INTRODUCTION TO CSS 2.1 & CSS 3              MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
nth of Type Pseudo-class :nth-of-type()
         Select multiple instances of sibling elements based on a formula

tbody tr:nth-of-type(2n+1) td {                  Monday          Tuesday    Wednesday
	 background-color: gray;
                                                    14             234         54
}
                                                    15             236         51
<table>
    <thead>                                         18             230         53
        <tr>
            <th scope="col">Monday</th>             14             233         50
            <th scope="col">Tuesday</th>
            <th scope="col">Wednesday</th>          14             236         55
        </tr>
    </thead>
    <tbody>
        <tr>                                   7          8
            <td>14</td>
            <td>234</td>
            <td>54</td>
                                               2          3     3.5
        </tr>
        <tr>                                    3         3.1     4
            <td>15</td>
            <td>236</td>
            <td>51</td>                        9
        </tr>
        ā€¦and so onā€¦



AN INTRODUCTION TO CSS 2.1 & CSS 3           MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Lets See Some Examples
                         Weā€™ll see examples of CSS that will...


       āœ“ Improve element and content targeting
       2. Replace outdated techniques for achieving
          certain design trends (lets stop making
          rounded corners and drop-shadows with
          images, eh?)
       3. Replace some actions and behaviors
          currently found in JavaScript



AN INTRODUCTION TO CSS 2.1 & CSS 3             MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Border Radius Property border-radius
                 Create rounded-corners on any block-level element

p {
	 border: 5px solid red;                           This is just some ļ¬ller content to make the
	 padding: 1em;                                    paragraph larger. This is just some ļ¬ller content to
                                                   make the paragraph larger. This is just some ļ¬ller
	 -moz-border-radius: 10px;                        content to make the paragraph larger. This is just
	 -webkit-border-radius: 10px;                     some ļ¬ller content to make the paragraph larger.
}                                                  This is just some ļ¬ller content to make the
                                                   paragraph larger. This is just some ļ¬ller content to
                                                   make the paragraph larger.

<p>This is just some filler content to make the
paragraph larger. This is just some filler
content to make the paragraph larger. This is
just some filler content to make the paragraph
larger. This is just some filler content to         7         8
make the paragraph larger. This is just some
filler content to make the paragraph larger.
This is just some filler content to make the
                                                    2         3         3.5
paragraph larger.</p>
                                                     3        3.1          4
                                                    9



AN INTRODUCTION TO CSS 2.1 & CSS 3                MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Box Shadow Property box-shadow
               Create a drop-shadow behind any block-level element

p {
                                                  This is just some ļ¬ller content to make the
	 background-color: black;
                                                  paragraph larger. This is just some ļ¬ller content to
	 padding: 1em;                                   make the paragraph larger. This is just some ļ¬ller
	 -moz-box-shadow: 3px 5px 15px white;            content to make the paragraph larger. This is just
	 -webkit-box-shadow: 3px 5px 15px white;         some ļ¬ller content to make the paragraph larger.
}                                                 This is just some ļ¬ller content to make the
                                                  paragraph larger. This is just some ļ¬ller content to
                                                  make the paragraph larger.


<p>This is just some filler content to make
the paragraph larger. This is just some filler
content to make the paragraph larger. This is
just some filler content to make the paragraph
larger. This is just some filler content to         7        8
make the paragraph larger. This is just some
filler content to make the paragraph larger.
This is just some filler content to make the
                                                    2         3        3.5
paragraph larger.</p>
                                                    3         3.1         4
                                                    9



AN INTRODUCTION TO CSS 2.1 & CSS 3               MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Text Shadow Property text-shadow
                            Create a drop-shadow behind text

p {
	 background-color: white;                     This content has a
	 color: white;
	 font-size: 2.5em;                            text-shadow.
	 font-weight: bold;
	 text-shadow: 2px 2px 6px black;
}


<p>This content has a text-shadow.</p>




                                                 7      8
                                                 2      3      3.5
                                                 3      3.1      4
                                                 9



AN INTRODUCTION TO CSS 2.1 & CSS 3            MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Multiple Background Images
                Use more than one background image in an element

#multipleBackgroundImages {
	 background-image: url(/images/gmail.png),       This is just some ļ¬ller content to make the
                                                  paragraph larger. This is just some ļ¬ller content to
                   url(/images/automator.gif);
                                                  make the paragraph larger. This is just some ļ¬ller
	 background-position: top left,                  content to make the paragraph larger.
                         bottom right;
	 background-repeat: no-repeat;                   This is just some ļ¬ller content to make the
	 border: 1px solid white;                        paragraph larger. This is just some ļ¬ller content to
                                                  make the paragraph larger. This is just some ļ¬ller
	 padding: 0 1em;
                                                  content to make the paragraph larger.
}


<div id="multipleBackgroundImages">
    <p>This is just some filler content to
    make the paragraph larger. This is just        7         8
    some filler content to make the paragraph
    larger. This is just some filler content
    to make the paragraph larger.</p>
                                                   2         3         3.5
    <p>This is just some filler content to
    make the paragraph larger. This is just         3        3.1          4
    some filler content to make the paragraph
    larger. This is just some filler content
    to make the paragraph larger.</p>
                                                   9
</div>




AN INTRODUCTION TO CSS 2.1 & CSS 3               MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Opacity Property opacity
                     Adjust an elementā€™s opacity on a scale of 0-1

p {
	 background-color: yellow;
	 opacity: .5;                                   This is just some ļ¬ller content to make the paragraph
	 padding: 1em;                                  larger. This is just some ļ¬ller content to make the
}                                                paragraph larger. This is just some ļ¬ller content to
                                                 make the paragraph larger. This is just some ļ¬ller
                                                 content to make the paragraph larger. This is just
                                                 some ļ¬ller content to make the paragraph larger. This
                                                 is just some ļ¬ller content to make the paragraph
<p>This is just some filler content to make      larger. This is just some ļ¬ller content to make the
the paragraph larger. This is just some filler   paragraph larger. This is just some ļ¬ller content to
content to make the paragraph larger. This is    make the paragraph larger. This is just some ļ¬ller
just some filler content to make the paragraph   content to make the paragraph larger.
larger. This is just some filler content to
make the paragraph larger. This is just some
filler content to make the paragraph larger.
This is just some filler content to make the
paragraph larger. This is just some filler         7         8
content to make the paragraph larger. This is
just some filler content to make the paragraph
larger. This is just some filler content to        2         3        3.5
make the paragraph larger.</p>
                                                    3        3.1         4
                                                   9
AN INTRODUCTION TO CSS 2.1 & CSS 3               MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
RGBa Value rgba(x, x, x, x)
                        Adjust a colorā€™s opacity on a scale of 0-1

p {
	 background-color: rgba(255, 255, 0, .5);
	 padding: 1em;                                  This is just some ļ¬ller content to make the paragraph
}                                                larger. This is just some ļ¬ller content to make the
                                                 paragraph larger. This is just some ļ¬ller content to
                                                 make the paragraph larger. This is just some ļ¬ller
                                                 content to make the paragraph larger. This is just
                                                 some ļ¬ller content to make the paragraph larger. This
                                                 is just some ļ¬ller content to make the paragraph
<p>This is just some filler content to make      larger. This is just some ļ¬ller content to make the
the paragraph larger. This is just some filler   paragraph larger. This is just some ļ¬ller content to
content to make the paragraph larger. This is    make the paragraph larger. This is just some ļ¬ller
just some filler content to make the paragraph   content to make the paragraph larger.
larger. This is just some filler content to
make the paragraph larger. This is just some
filler content to make the paragraph larger.
This is just some filler content to make the
paragraph larger. This is just some filler         7         8
content to make the paragraph larger. This is
just some filler content to make the paragraph
larger. This is just some filler content to        2         3        3.5
make the paragraph larger.</p>
                                                    3        3.1         4
                                                   9
AN INTRODUCTION TO CSS 2.1 & CSS 3               MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Lets See Some Examples
                         Weā€™ll see examples of CSS that will...


       āœ“ Improve element and content targeting
       āœ“ Replace outdated techniques for achieving
         certain design trends (lets stop making
         rounded corners and drop-shadows with
         images, eh?)
       3. Replace some actions and behaviors
          currently found in JavaScript



AN INTRODUCTION TO CSS 2.1 & CSS 3             MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Min/Max Height/Width Properties
 min-height, max-height, min-width, & max-width
        Allow an element to grow or shrink until it reaches a certain size

#minHeight {               #minWidth {           <p id="minHeight">This is just some filler
	 min-height: 100px;       	 min-width: 900px;   content to make the paragraph larger.</p>
}                          }                     <p id="maxHeight">This is just some filler
#maxHeight {               #maxWidth {           content to make the paragraph larger. This is
	 max-height: 12px;        	 max-width: 700px;   just some filler content to make the paragraph
	 overflow: hidden;        }                     larger. This is just some filler content to
}                                                make the paragraph larger.</p>
                                                 <p id="minWidth">This is just some filler
                                                 content to make the paragraph larger. This is
                                                 just some filler content to make the paragraph
   7      8                                      larger. This is just some filler content to
                                                 make the paragraph larger.</p>
                                                 <p id="maxWidth">This is just some filler
   2      3      3.5                             content to make the paragraph larger. This is
                                                 just some filler content to make the paragraph
                                                 larger. This is just some filler content to
   3      3.1          4                         make the paragraph larger.</p>

   9
                                                 Browser demo time!

AN INTRODUCTION TO CSS 2.1 & CSS 3               MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Column Properties
                   column-width & column-gap
                                   Automatically create columns

#columnProperty {                                   These three          make the            paragraph larger.
	 -moz-column-gap: 2em;                             paragraphs are       paragraph larger.
                                                    inside of a single   This is just some   This is just some
	 -moz-column-width: 10em;
                                                    div that has         ļ¬ller content to    ļ¬ller content to
	 -webkit-column-gap: 2em;                          column               make the            make the
	 -webkit-column-width: 10em;                       properties           paragraph larger.   paragraph larger.
}                                                   applied to it.       This is just some   This is just some
                                                    Look closely,        ļ¬ller content to    ļ¬ller content to
<div id="columnProperty">                           there is no          make the            make the
    <p>These three paragraphs are inside of a       ļ¬‚oating or           paragraph larger.   paragraph larger.
    single div that has column properties applied   positioning going    This is just some   This is just some
    to it. Look closely, there is no floating or    on here.             ļ¬ller content to    ļ¬ller content to
    positioning going on here.</p>                                       make the            make the
    <p>This is just some filler content to make     This is just some                        paragraph larger.
    the paragraph larger. This is just some         ļ¬ller content to
    filler content to make the paragraph larger.
    This is just some filler content to make the
    paragraph larger. This is just some filler
    content to make the paragraph larger.</p>
                                                        2        3          3.5
    <p>This is just some filler content to make
    the paragraph larger. This is just some             3        3.1          4
    filler content to make the paragraph larger.
    This is just some filler content to make the        7        8          9
    paragraph larger.</p>
</div>

AN INTRODUCTION TO CSS 2.1 & CSS 3                  MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Resize Property resize
                     Allow an element to be resized by the visitor

p {
	 overflow: auto;                              Browser demo time!
	 resize: both;
	 width: 325px;
}



<p>This paragraph can be resized both
horizontally and vertically. It looks like a
text input field, but it&rsquo;s not.</p>



                                                 7       8
                                                 2       3      3.5
                                                  3      3.1      4
                                                 9



AN INTRODUCTION TO CSS 2.1 & CSS 3             MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Text Overļ¬‚ow Property text-overflow
      Characters that approach the edge of an element become an ellipsis

p {
	 border: 1px solid white;                        This is just some ļ¬ller content to make the paragra...
	 overflow: hidden;
	 padding: 1em;
	 text-overflow: ellipsis;
	 white-space: nowrap;
}                                                Browser demo time!

<p>This is just some filler content to make
the paragraph larger. This is just some filler
                                                    7         8
content to make the paragraph larger. This is
just some filler content to make the paragraph      2         3         3.5
larger. This is just some filler content to
make the paragraph larger. This is just some
filler content to make the paragraph larger.        3         3.1          4
This is just some filler content to make the
paragraph larger.</p>                               9 (requires -o-text-overflow)




AN INTRODUCTION TO CSS 2.1 & CSS 3               MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Transition Property -webkit-transition
                                 Basic animation, with CSS

p {                                             <p   class="scale">Example 1</p>
	 border: 1px solid black;                      <p   class="slideLeft">Example 2</p>
	 float: left;                                  <p   class="slideRight">Example 3</p>
	 margin-right: 2em;                            <p   class="rotate">Example 4</p>
	 padding: 1em;
	 text-align: center;
	 width: 100px;

}
    -webkit-transition: all 1s ease-in-out;
                                                Browser demo time!
.scale:hover {
	 -moz-transform: scale(2);
	 -webkit-transform: scale(2);
}
.slideLeft:hover {                                   7      8
	 -moz-transform: translate(-3em,1em);
	 -webkit-transform: translate(-3em,1em);
}
                                                     2      3       3.5 (sort ofā€¦)
.slideRight:hover {
	 -moz-transform: translate(3em,0);                  3      3.1        4
	 -webkit-transform: translate(3em,0);
}
.rotate:hover {
                                                     9
	 -moz-transform: rotate(30deg);
	 -webkit-transform: rotate(30deg);
}

AN INTRODUCTION TO CSS 2.1 & CSS 3              MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Lets See Some Examples
                         Weā€™ll see examples of CSS that will...


       āœ“ Improve element and content targeting
       āœ“ Replace outdated techniques for achieving
         certain design trends (lets stop making
                                     </ļ¬n>
         rounded corners and drop-shadows with
         images, eh?)
       āœ“ Replace some actions and behaviors
           currently found in JavaScript



AN INTRODUCTION TO CSS 2.1 & CSS 3             MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Conclusion
                            Allow myself to conclude myself


       ā€¢ Browser support varies, drastically in some
         cases. Choose wisely based on your
         audience and the browsers they use.




AN INTRODUCTION TO CSS 2.1 & CSS 3            MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Conclusion
                            Allow myself to conclude myself


       ā€¢ Browser support varies, drastically in some
         cases. Choose wisely based on your
         audience and the browsers they use.
       ā€¢ That said, a handful of these selectors and
         properties can be used as ā€œadded
         awesome,ā€ visible only to those who use
         better browsers without ruining the
         experience for those using older browsers.



AN INTRODUCTION TO CSS 2.1 & CSS 3            MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Conclusion
                            Allow myself to conclude myself


       ā€¢ Browser support varies, drastically in some
         cases. Choose wisely based on your
         audience and the browsers they use.
       ā€¢ That said, a handful of these selectors and
         properties can be used as ā€œadded
         awesome,ā€ visible only to those who use
         better browsers without ruining the
         experience for those using older browsers.
       ā€¢ DEVELOPER DAY is incredible.

AN INTRODUCTION TO CSS 2.1 & CSS 3            MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
Questions?

(re)sources:                               links:
ā€¢   CSS Current Work                       ā€¢   The demonstration page
    http://www.w3.org/Style/CSS/current-       http://marcamos.com/presentation/
    work                                       intro-css2.1-css3/

ā€¢   Quirksmode (Peter-Paul Koch)           ā€¢   My personal website
    http://www.quirksmode.org/css/             http://www.marcamos.com
    contents.html
                                           ā€¢   Boston Web Studio
ā€¢   CSS3.info
                                               http://www.bostonwebstudio.com
    http://www.css3.info
                                           ā€¢   The Build Guild
ā€¢   My Brain
                                               http://www.buildguild.org
    localhost



AN INTRODUCTION TO CSS 2.1 & CSS 3         MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
</awesomePresentation>

AN INTRODUCTION TO CSS 2.1 & CSS 3   MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD

More Related Content

Recently uploaded

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
Ā 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vƔzquez
Ā 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
Ā 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
Ā 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
Ā 
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelDeepika Singh
Ā 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
Ā 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĆŗjo
Ā 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
Ā 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
Ā 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
Ā 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
Ā 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
Ā 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
Ā 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
Ā 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
Ā 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
Ā 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
Ā 

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Ā 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Ā 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Ā 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
Ā 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
Ā 
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Ā 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
Ā 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Ā 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Ā 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
Ā 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
Ā 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
Ā 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Ā 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Ā 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
Ā 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Ā 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Ā 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Ā 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Ā 

Featured

2024 State of Marketing Report ā€“ by Hubspot
2024 State of Marketing Report ā€“ by Hubspot2024 State of Marketing Report ā€“ by Hubspot
2024 State of Marketing Report ā€“ by HubspotMarius Sescu
Ā 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
Ā 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
Ā 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
Ā 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
Ā 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
Ā 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
Ā 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
Ā 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
Ā 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
Ā 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
Ā 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
Ā 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
Ā 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
Ā 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data ScienceChristy Abraham Joy
Ā 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
Ā 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
Ā 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
Ā 

Featured (20)

2024 State of Marketing Report ā€“ by Hubspot
2024 State of Marketing Report ā€“ by Hubspot2024 State of Marketing Report ā€“ by Hubspot
2024 State of Marketing Report ā€“ by Hubspot
Ā 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Ā 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Ā 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
Ā 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Ā 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Ā 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Ā 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
Ā 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Ā 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Ā 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Ā 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
Ā 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Ā 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Ā 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Ā 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Ā 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Ā 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Ā 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
Ā 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Ā 

Introduction to CSS 2.1 and CSS 3

  • 1. AN INTRODUCTION TO CSS 2.1 & CSS 3 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 2. A Few Questions Itā€™s hand-raising time ā€¢ How many of you are designers? AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 3. A Few Questions Itā€™s hand-raising time ā€¢ How many of you are designers? ā€¢ How many of you are front-end developers? AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 4. A Few Questions Itā€™s hand-raising time ā€¢ How many of you are designers? ā€¢ How many of you are front-end developers? ā€¢ How many of you are back-end developers? AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 5. A Few Questions Itā€™s hand-raising time ā€¢ How many of you are designers? ā€¢ How many of you are front-end developers? ā€¢ How many of you are back-end developers? ā€¢ How many of you are all of the above? AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 6. A Few Questions Itā€™s hand-raising time ā€¢ How many of you are designers? ā€¢ How many of you are front-end developers? ā€¢ How many of you are back-end developers? ā€¢ How many of you are all of the above? ā€¢ How many of you are none of the above? AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 7. A Few Questions Itā€™s hand-raising time ā€¢ How many of you are designers? ā€¢ How many of you are front-end developers? ā€¢ How many of you are back-end developers? ā€¢ How many of you are all of the above? ā€¢ How many of you are none of the above? ā€¢ How many of you hate raising your hand? AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 8. Disclaimer(s) Setting expectations & protecting my butt ā€¢ This is an introduction to CSS 2.1 and CSS 3 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 9. Disclaimer(s) Setting expectations & protecting my butt ā€¢ This is an introduction to CSS 2.1 and CSS 3 ā€¢ CSS 2.1 and CSS 3 are not fully supported AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 10. Disclaimer(s) Setting expectations & protecting my butt ā€¢ This is an introduction to CSS 2.1 and CSS 3 ā€¢ CSS 2.1 and CSS 3 are not fully supported ā€¢ Nearly everything youā€™ll see will not work in Internet Explorer 6 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 11. Disclaimer(s) Setting expectations & protecting my butt ā€¢ This is an introduction to CSS 2.1 and CSS 3 ā€¢ CSS 2.1 and CSS 3 are not fully supported ā€¢ Nearly everything youā€™ll see will not work in Internet Explorer 6 ā€¢ We donā€™t like Internet Explorer 6 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 12. Disclaimer(s) Setting expectations & protecting my butt ā€¢ This is an introduction to CSS 2.1 and CSS 3 ā€¢ CSS 2.1 and CSS 3 are not fully supported ā€¢ Nearly everything youā€™ll see will not work in Internet Explorer 6 ā€¢ We donā€™t like Internet Explorer 6 ā€¢ Or 7 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 13. Disclaimer(s) Setting expectations & protecting my butt ā€¢ This is an introduction to CSS 2.1 and CSS 3 ā€¢ CSS 2.1 and CSS 3 are not fully supported ā€¢ Nearly everything youā€™ll see will not work in Internet Explorer 6 ā€¢ We donā€™t like Internet Explorer 6 ā€¢ Or 7 ā€¢ 8 is OK AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 14. The History of CSS The new stuff is old & itā€™s out of order ā€¢ CSS 1 became a W3C recommendation in December of 1996 http://www.w3.org/TR/CSS1/ AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 15. The History of CSS The new stuff is old & itā€™s out of order ā€¢ CSS 1 became a W3C recommendation in December of 1996 http://www.w3.org/TR/CSS1/ ā€¢ CSS 2 became a W3C recommendation in May of 1998 http://www.w3.org/TR/2008/REC-CSS2-20080411/ AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 16. The History of CSS The new stuff is old & itā€™s out of order ā€¢ CSS 1 became a W3C recommendation in December of 1996 http://www.w3.org/TR/CSS1/ ā€¢ CSS 2 became a W3C recommendation in May of 1998 http://www.w3.org/TR/2008/REC-CSS2-20080411/ ā€¢ CSS 3 became a W3C working draft in April of 2000 http://www.w3.org/TR/2000/WD-css3-selectors-20000410 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 17. The History of CSS The new stuff is old & itā€™s out of order ā€¢ CSS 1 became a W3C recommendation in December of 1996 http://www.w3.org/TR/CSS1/ ā€¢ CSS 2 became a W3C recommendation in May of 1998 http://www.w3.org/TR/2008/REC-CSS2-20080411/ ā€¢ CSS 3 became a W3C working draft in April of 2000 http://www.w3.org/TR/2000/WD-css3-selectors-20000410 ā€¢ CSS 2.1 became a W3C working draft in August of 2002 http://www.w3.org/TR/2002/WD- CSS21-20020802/ AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 18. Lets See Some Examples Weā€™ll see examples of CSS that will... 1. Improve element and content targeting AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 19. Lets See Some Examples Weā€™ll see examples of CSS that will... 1. Improve element and content targeting 2. Replace outdated techniques for achieving certain design trends (lets stop making rounded corners and drop-shadows with images, eh?) AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 20. Lets See Some Examples Weā€™ll see examples of CSS that will... 1. Improve element and content targeting 2. Replace outdated techniques for achieving certain design trends (lets stop making rounded corners and drop-shadows with images, eh?) 3. Replace some actions and behaviors currently found in JavaScript AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 21. Lets See Some Examples Weā€™ll see examples of CSS that will... 1. Improve element and content targeting 2. Replace outdated techniques for achieving certain design trends (lets stop making rounded corners and drop-shadows with images, eh?) 3. Replace some actions and behaviors currently found in JavaScript AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 22. Child Selector > Select any element thatā€™s a child of another element #childSelector > p { This content is targeted. color: red; ā€¢ This content is NOT targeted } ā€¢ This content is NOT targeted This content is NOT targeted. <div id="childSelector"> This content is targeted. <p>This content is targeted.</p> This content is targeted. <ul> <li>This content is NOT targeted.</li> <li>This content is NOT targeted.</li> </ul> <blockquote> <p>This content is NOT targeted.</p> 7 8 </blockquote> <p>This content is targeted.</p> <p>This content is targeted.</p> 2 3 3.5 </div> 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 23. Adjacent Sibling Selector + Select an element thatā€™s a direct sibling of another element blockquote + p { This content is NOT targeted. color: red; This content is inside of a blockquote. } This content is targeted. This content is NOT targeted. <p>This content is NOT targeted.</p> <blockquote> <p>This content is inside of a blockquote.</p> </blockquote> <p>This content is targeted.</p> <p>This content is NOT targeted.</p> 7 8 2 3 3.5 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 24. General Sibling Selector ~ Select an element thatā€™s a sibling of another element blockquote ~ p { This content is NOT targeted. color: red; This content is inside of a blockquote. } This content is targeted. This content is targeted. <p>This content is NOT targeted.</p> This content is NOT targeted. <blockquote> <p>This content is inside of a blockquote.</p> This content is targeted. </blockquote> <p>This content is targeted.</p> <p>This content is targeted.</p> <div> <p>This content is NOT targeted.</p> 7 8 </div> <p>This content is targeted.</p> 2 3 3.5 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 25. Attribute Selector [name=value] Select an element that has a particular attribute & value input[type=text] { border-color: red; } <input type="password" name="one" /> <input type="text" name="two" /> 7 8 2 3 3.5 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 26. First Child Pseudo-class :first-child Select only the first child element among many of its siblings ul li:first-child { ā€¢ This content is targeted color: red; ā€¢ This content is NOT targeted } ā€¢ This content is NOT targeted ā€¢ This content is NOT targeted ā€¢ This content is NOT targeted <ul> <li>This content is targeted</li> <li>This content is NOT targeted</li> <li>This content is NOT targeted</li> <li>This content is NOT targeted</li> <li>This content is NOT targeted</li> </ul> 7 8 2 3 3.5 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 27. Last Child Pseudo-class :last-child Select only the last child element among many of its siblings ul li:last-child { ā€¢ This content is NOT targeted color: red; ā€¢ This content is NOT targeted } ā€¢ This content is NOT targeted ā€¢ This content is NOT targeted ā€¢ This content is targeted <ul> <li>This content is NOT targeted</li> <li>This content is NOT targeted</li> <li>This content is NOT targeted</li> <li>This content is NOT targeted</li> <li>This content is targeted</li> </ul> 7 8 2 3 3.5 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 28. First Letter Pseudo-element :first-letter Select the first letter in any element p:first-letter { color: red; The ļ¬rst letter in this paragraph is targeted. font-size: 2em; } <p>The first letter in this paragraph is targeted.</p> 7 8 2 3 3.5 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 29. First Line Pseudo-element :first-line Dynamically select the first line of text in any element p:first-line { The ļ¬rst line of this paragraph is targeted. Resize your color: red; browser window and watch how, regardless of where } words move, only those words found in the ļ¬rst line remain targeted. This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller content to make the paragraph larger. <p>The first line of this paragraph is targeted. Resize your browser window and watch how, regardless of where words move, only those words found in the first line remain targeted. This is just some filler content to make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler content to make the 7 8 paragraph larger.</p> 2 3 3.5 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 30. Enabled, Disabled, & Checked Pseudo-classes :enabled, :disabled, :checked Change the appearance of form inputs based on their status :enabled { This input is enabled border-color: green; } This input is disabled :disabled { border-color: red; This checkbox is initially checked } :checked { margin-left: 50px; } 7 8 <input type="text" value="This input is enabled" /> 2 3 3.5 <input type="text" disabled="disabled" value="This input is disabled" /> <label> 3 3.1 4 <input type="checkbox" checked="checked" /> This checkbox is initially checked </label> 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 31. nth of Type Pseudo-class :nth-of-type() Select multiple instances of sibling elements based on a formula tbody tr:nth-of-type(2n+1) td { Monday Tuesday Wednesday background-color: gray; 14 234 54 } 15 236 51 <table> <thead> 18 230 53 <tr> <th scope="col">Monday</th> 14 233 50 <th scope="col">Tuesday</th> <th scope="col">Wednesday</th> 14 236 55 </tr> </thead> <tbody> <tr> 7 8 <td>14</td> <td>234</td> <td>54</td> 2 3 3.5 </tr> <tr> 3 3.1 4 <td>15</td> <td>236</td> <td>51</td> 9 </tr> ā€¦and so onā€¦ AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 32. Lets See Some Examples Weā€™ll see examples of CSS that will... āœ“ Improve element and content targeting 2. Replace outdated techniques for achieving certain design trends (lets stop making rounded corners and drop-shadows with images, eh?) 3. Replace some actions and behaviors currently found in JavaScript AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 33. Border Radius Property border-radius Create rounded-corners on any block-level element p { border: 5px solid red; This is just some ļ¬ller content to make the padding: 1em; paragraph larger. This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller -moz-border-radius: 10px; content to make the paragraph larger. This is just -webkit-border-radius: 10px; some ļ¬ller content to make the paragraph larger. } This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller content to make the paragraph larger. <p>This is just some filler content to make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler content to 7 8 make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler content to make the 2 3 3.5 paragraph larger.</p> 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 34. Box Shadow Property box-shadow Create a drop-shadow behind any block-level element p { This is just some ļ¬ller content to make the background-color: black; paragraph larger. This is just some ļ¬ller content to padding: 1em; make the paragraph larger. This is just some ļ¬ller -moz-box-shadow: 3px 5px 15px white; content to make the paragraph larger. This is just -webkit-box-shadow: 3px 5px 15px white; some ļ¬ller content to make the paragraph larger. } This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller content to make the paragraph larger. <p>This is just some filler content to make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler content to 7 8 make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler content to make the 2 3 3.5 paragraph larger.</p> 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 35. Text Shadow Property text-shadow Create a drop-shadow behind text p { background-color: white; This content has a color: white; font-size: 2.5em; text-shadow. font-weight: bold; text-shadow: 2px 2px 6px black; } <p>This content has a text-shadow.</p> 7 8 2 3 3.5 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 36. Multiple Background Images Use more than one background image in an element #multipleBackgroundImages { background-image: url(/images/gmail.png), This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller content to url(/images/automator.gif); make the paragraph larger. This is just some ļ¬ller background-position: top left, content to make the paragraph larger. bottom right; background-repeat: no-repeat; This is just some ļ¬ller content to make the border: 1px solid white; paragraph larger. This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller padding: 0 1em; content to make the paragraph larger. } <div id="multipleBackgroundImages"> <p>This is just some filler content to make the paragraph larger. This is just 7 8 some filler content to make the paragraph larger. This is just some filler content to make the paragraph larger.</p> 2 3 3.5 <p>This is just some filler content to make the paragraph larger. This is just 3 3.1 4 some filler content to make the paragraph larger. This is just some filler content to make the paragraph larger.</p> 9 </div> AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 37. Opacity Property opacity Adjust an elementā€™s opacity on a scale of 0-1 p { background-color: yellow; opacity: .5; This is just some ļ¬ller content to make the paragraph padding: 1em; larger. This is just some ļ¬ller content to make the } paragraph larger. This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller content to make the paragraph <p>This is just some filler content to make larger. This is just some ļ¬ller content to make the the paragraph larger. This is just some filler paragraph larger. This is just some ļ¬ller content to content to make the paragraph larger. This is make the paragraph larger. This is just some ļ¬ller just some filler content to make the paragraph content to make the paragraph larger. larger. This is just some filler content to make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler 7 8 content to make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler content to 2 3 3.5 make the paragraph larger.</p> 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 38. RGBa Value rgba(x, x, x, x) Adjust a colorā€™s opacity on a scale of 0-1 p { background-color: rgba(255, 255, 0, .5); padding: 1em; This is just some ļ¬ller content to make the paragraph } larger. This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller content to make the paragraph larger. This is just some ļ¬ller content to make the paragraph <p>This is just some filler content to make larger. This is just some ļ¬ller content to make the the paragraph larger. This is just some filler paragraph larger. This is just some ļ¬ller content to content to make the paragraph larger. This is make the paragraph larger. This is just some ļ¬ller just some filler content to make the paragraph content to make the paragraph larger. larger. This is just some filler content to make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler 7 8 content to make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler content to 2 3 3.5 make the paragraph larger.</p> 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 39. Lets See Some Examples Weā€™ll see examples of CSS that will... āœ“ Improve element and content targeting āœ“ Replace outdated techniques for achieving certain design trends (lets stop making rounded corners and drop-shadows with images, eh?) 3. Replace some actions and behaviors currently found in JavaScript AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 40. Min/Max Height/Width Properties min-height, max-height, min-width, & max-width Allow an element to grow or shrink until it reaches a certain size #minHeight { #minWidth { <p id="minHeight">This is just some filler min-height: 100px; min-width: 900px; content to make the paragraph larger.</p> } } <p id="maxHeight">This is just some filler #maxHeight { #maxWidth { content to make the paragraph larger. This is max-height: 12px; max-width: 700px; just some filler content to make the paragraph overflow: hidden; } larger. This is just some filler content to } make the paragraph larger.</p> <p id="minWidth">This is just some filler content to make the paragraph larger. This is just some filler content to make the paragraph 7 8 larger. This is just some filler content to make the paragraph larger.</p> <p id="maxWidth">This is just some filler 2 3 3.5 content to make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler content to 3 3.1 4 make the paragraph larger.</p> 9 Browser demo time! AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 41. Column Properties column-width & column-gap Automatically create columns #columnProperty { These three make the paragraph larger. -moz-column-gap: 2em; paragraphs are paragraph larger. inside of a single This is just some This is just some -moz-column-width: 10em; div that has ļ¬ller content to ļ¬ller content to -webkit-column-gap: 2em; column make the make the -webkit-column-width: 10em; properties paragraph larger. paragraph larger. } applied to it. This is just some This is just some Look closely, ļ¬ller content to ļ¬ller content to <div id="columnProperty"> there is no make the make the <p>These three paragraphs are inside of a ļ¬‚oating or paragraph larger. paragraph larger. single div that has column properties applied positioning going This is just some This is just some to it. Look closely, there is no floating or on here. ļ¬ller content to ļ¬ller content to positioning going on here.</p> make the make the <p>This is just some filler content to make This is just some paragraph larger. the paragraph larger. This is just some ļ¬ller content to filler content to make the paragraph larger. This is just some filler content to make the paragraph larger. This is just some filler content to make the paragraph larger.</p> 2 3 3.5 <p>This is just some filler content to make the paragraph larger. This is just some 3 3.1 4 filler content to make the paragraph larger. This is just some filler content to make the 7 8 9 paragraph larger.</p> </div> AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 42. Resize Property resize Allow an element to be resized by the visitor p { overflow: auto; Browser demo time! resize: both; width: 325px; } <p>This paragraph can be resized both horizontally and vertically. It looks like a text input field, but it&rsquo;s not.</p> 7 8 2 3 3.5 3 3.1 4 9 AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 43. Text Overļ¬‚ow Property text-overflow Characters that approach the edge of an element become an ellipsis p { border: 1px solid white; This is just some ļ¬ller content to make the paragra... overflow: hidden; padding: 1em; text-overflow: ellipsis; white-space: nowrap; } Browser demo time! <p>This is just some filler content to make the paragraph larger. This is just some filler 7 8 content to make the paragraph larger. This is just some filler content to make the paragraph 2 3 3.5 larger. This is just some filler content to make the paragraph larger. This is just some filler content to make the paragraph larger. 3 3.1 4 This is just some filler content to make the paragraph larger.</p> 9 (requires -o-text-overflow) AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 44. Transition Property -webkit-transition Basic animation, with CSS p { <p class="scale">Example 1</p> border: 1px solid black; <p class="slideLeft">Example 2</p> float: left; <p class="slideRight">Example 3</p> margin-right: 2em; <p class="rotate">Example 4</p> padding: 1em; text-align: center; width: 100px; } -webkit-transition: all 1s ease-in-out; Browser demo time! .scale:hover { -moz-transform: scale(2); -webkit-transform: scale(2); } .slideLeft:hover { 7 8 -moz-transform: translate(-3em,1em); -webkit-transform: translate(-3em,1em); } 2 3 3.5 (sort ofā€¦) .slideRight:hover { -moz-transform: translate(3em,0); 3 3.1 4 -webkit-transform: translate(3em,0); } .rotate:hover { 9 -moz-transform: rotate(30deg); -webkit-transform: rotate(30deg); } AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 45. Lets See Some Examples Weā€™ll see examples of CSS that will... āœ“ Improve element and content targeting āœ“ Replace outdated techniques for achieving certain design trends (lets stop making </ļ¬n> rounded corners and drop-shadows with images, eh?) āœ“ Replace some actions and behaviors currently found in JavaScript AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 46. Conclusion Allow myself to conclude myself ā€¢ Browser support varies, drastically in some cases. Choose wisely based on your audience and the browsers they use. AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 47. Conclusion Allow myself to conclude myself ā€¢ Browser support varies, drastically in some cases. Choose wisely based on your audience and the browsers they use. ā€¢ That said, a handful of these selectors and properties can be used as ā€œadded awesome,ā€ visible only to those who use better browsers without ruining the experience for those using older browsers. AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 48. Conclusion Allow myself to conclude myself ā€¢ Browser support varies, drastically in some cases. Choose wisely based on your audience and the browsers they use. ā€¢ That said, a handful of these selectors and properties can be used as ā€œadded awesome,ā€ visible only to those who use better browsers without ruining the experience for those using older browsers. ā€¢ DEVELOPER DAY is incredible. AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 49. Questions? (re)sources: links: ā€¢ CSS Current Work ā€¢ The demonstration page http://www.w3.org/Style/CSS/current- http://marcamos.com/presentation/ work intro-css2.1-css3/ ā€¢ Quirksmode (Peter-Paul Koch) ā€¢ My personal website http://www.quirksmode.org/css/ http://www.marcamos.com contents.html ā€¢ Boston Web Studio ā€¢ CSS3.info http://www.bostonwebstudio.com http://www.css3.info ā€¢ The Build Guild ā€¢ My Brain http://www.buildguild.org localhost AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD
  • 50. </awesomePresentation> AN INTRODUCTION TO CSS 2.1 & CSS 3 MARC AMOS / BOSTON WEB STUDIO / BUILD GUILD