Implementing The New Features: Mark Branom, IT Services John Foliot, Stanford Online Accessibility Program
Implementing The New Features: Mark Branom, IT Services John Foliot, Stanford Online Accessibility Program
Content: XHTML 1
Presentation: CSS2
Brief history… 2007-present
Content: HTML5
Presentation: CSS3
Vendor Prefixes
Some CSS rules won’t work without the vendor prefix.
Mozilla Browsers (Firefox)
-moz
Opera
-o
Internet Explorer
-ms
<!--[if IE]> <![endif]-->
[attribute^=value]
Represents an element with the attribute whose value begins with the
prefix value.
[attribute$=value]
Represents an element with the attribute whose value ends with the
prefix value.
[attribute*=value]
Represents an element with the attribute whose value contains the
prefix value.
Example:
http://www.quirksmode.org/css/selector_attributeAdvanced.html
New pseudo elements/classes!
:first-of-type
:last-of-type
:only-of-type
Select elements that are first, last, or only child of its type of its parent
Example:
http://www.quirksmode.org/css/type.html
:first-child
:only-child
:last-child
Selects an element that is the first, only, or last child of its parent.
Examples:
http://www.quirksmode.org/css/firstchild.html
http://www.quirksmode.org/css/onlychild.html
More new pseudo elements/classes!
nth-child(n)
:nth-of-type(n)
Allows you to select elements with a formula.
Example:
http://www.quirksmode.org/css/nthchild.html
:nth-last-child(n)
:nth-last-of-type(n)
Work same as nth-child, except that they start counting at the last element instead of the first.
Example:
http://www.quirksmode.org/css/nthlastchild.html
:root
Selects the root initial containing block (in HTML, this is the <html> tag)
Example:
http://www.quirksmode.org/css/root.html
:empty
Selects elements with no content (“empty”).
Example:
http://www.quirksmode.org/css/empty.html
:target
Selects a targeted element – one with an ID with the same value as the URL's hash.
Example:
http://www.quirksmode.org/css/target.html
http://www.quirksmode.org/css/target.html#testHash
Still more new pseudo elements/classes!
:enabled
:disabled
:checked
Allows a designer to apply style to enabled, disabled, or checked
form field elements.
Example:
http://www.quirksmode.org/css/enabled.html
:not(selector)
Negates a selector.
Example:
http://www.quirksmode.org/css/not.html
::selection
Defines style for text that a user selects.
Example:
http://www.quirksmode.org/css/selection.html
New properties! (and some new
property groups!)
CSS Property Groups:
• Animation • Generated • Positioning
• Background content • Print
• Border and • Grid • Ruby
outline • Hyperlink • Speech
• Box • Linebox • Table
• Color • List • Text
• Content Paged • Margin • 2D/3D Transform
Media • Marquee • Transition
• Dimension • Multi-column • User-interface
• Flexible Box • Padding
• Font • Paged Media
Animation
@keyframes
Specifies the animation
animation
A shorthand property for all the animation properties below, except the animation-play-state property
animation-name
Specifies a name for the @keyframes animation
animation-duration
Specifies how many seconds or milliseconds an animation takes to complete one cycle
animation-timing-function
Specifies the speed curve of the animation
animation-delay
Specifies when the animation will start
animation-iteration-count
Specifies the number of times an animation should be played
animation-direction
Specifies whether or not the animation should play in reverse on alternate cycles
animation-play-state
Specifies whether the animation is running or paused
Examples:
http://www.leemunroe.com/css3-animations/
http://css3.bradshawenterprises.com/animations/
http://www.w3schools.com/css3/tryit.asp?filename=trycss3_animation1
http://www.standardista.com/sxsw/#slide24
Transition
transition
A shorthand property for setting the four transition
properties
transition-property
Specifies the name of the CSS property the transition effect
is for
transition-duration
Specifies how many seconds or milliseconds a transition
effect takes to complete
transition-timing-function
Specifies the speed curve of the transition effect
transition-delay
Specifies when the transition effect will start
Example:
http://css3.bradshawenterprises.com/transitions/
Transform
transform
Applies a 2D or 3D transformation to an element
transform-origin
Allows you to change the position on transformed elements
transform-style
Specifies how nested elements are rendered in 3D space
perspective
Specifies the perspective on how 3D elements are viewed
perspective-origin
Specifies the bottom position of 3D elements
backface-visibility
Defines whether or not an element should be visible when not facing the
screen
Examples:
http://westciv.com/tools/3Dtransforms/index.html
http://css3.bradshawenterprises.com/transforms/
Background
background-clip
Specifies the painting area of the background
background-origin
Specifies the positioning area of the background images
background-size
Specifies the size of the background images
Example:
http://www.css3.info/preview/background-origin-and-background-clip/
background-gradient
Specifies a gradient (shifting from one color to another) in the
background
Examples:
http://www.stanford.edu/group/ttsclasses/cgi-bin/techietips/?p=485
http://css-tricks.com/5700-css3-gradients/
http://www.standardista.com/sxsw/#slide3
Border
border-bottom-left-radius
Defines the shape of the border of the bottom-left corner
border-bottom-right-radius
Defines the shape of the border of the bottom-right corner
border-image
A shorthand property for setting all the border-image-* properties
border-image-outset
Specifies the amount by which the border image area extends beyond the border box
border-image-repeat
Specifies whether the image-border should be repeated, rounded or stretched
border-image-slice
Specifies the inward offsets of the image-border
border-image-source
Specifies an image to be used as a border
border-image-width
Specifies the widths of the image-border
border-radius
A shorthand property for setting all the four border-*-radius properties
border-top-left-radius
Defines the shape of the border of the top-left corner
border-top-right-radius
Defines the shape of the border of the top-right corner
Examples:
http://www.css3.info/preview/rounded-border/
http://border-radius.com/
Box
box-decoration-break
Defines a break in the box’s decoration
Example: http://www.w3.org/TR/css3-background/#the-box-decoration-break
box-shadow
Attaches one or more drop-shadows to the box
Examples:
http://www.css3.info/preview/box-shadow/
http://www.standardista.com/sxsw/#slide9
overflow-x
Specifies whether or not to clip the left/right edges of the content, if it
overflows the element's content area
overflow-y
Specifies whether or not to clip the top/bottom edges of the content, if it
overflows the element's content area
overflow-style
Specifies the preferred scrolling method for elements that overflow
Example: http://www.css3.info/overflow-xoverflow-y
Flexible Box
Specification is still under development…Stay Tuned!!!
Example:
http://www.html5rocks.com/en/tutorials/flexbox/quick/
Color
RGBA(Red,Green,Blue,Alpha opacity)
rgba(100%,0%,0%,0.8) produces 80% red.
Examples:
http://www.css3.info/preview/rgba/
http://hex2rgba.devoth.com/
opacity
Sets the opacity level for an element from 0 to 1.0.
Example:
http://www.css3.info/preview/opacity/
http://www.standardista.com/sxsw/#slide6
Font
Free web fonts:
http://www.google.com/webfonts
http://www.fontsquirrel.com
@font-face
A rule that allows websites to download and use fonts other than the "web-safe"
fonts
Examples:
http://css-tricks.com/snippets/css/using-font-face/
http://www.css3.info/preview/web-fonts-with-font-face/
font-size-adjust
Preserves the readability of text when font fallback occurs
Example:
http://www.w3.org/TR/css3-fonts/#font-size-adjust-prop
font-stretch
Selects a normal, condensed, or expanded face from a font family
Example: Currently no browser supports font-stretch
Text
hanging-punctuation
Specifies whether a punctuation character may be placed outside the line box
Example: Currently no browser supports hanging-punctuation
punctuation-trim
Specifies whether a punctuation character should be trimmed
Example: Currently no browser supports punctuation-trim
text-outline
Specifies a text outline
Example: Currently no browser supports text-outline
text-wrap
Specifies line breaking rules for text
Example: Currently no browser supports text-wrap
text-align-last
Describes how the last line of a block or a line right before a forced line break is aligned when text-
align is "justify"
Example:
http://msdn.microsoft.com/en-us/library/ms531163(VS.85).aspx
Text (continued)
text-justify
Specifies the justification method used when text-align is "justify"
Example:
http://msdn.microsoft.com/en-us/library/ms531172(v=VS.85).aspx
text-shadow
Adds shadow to text
Examples:
http://www.css3.info/preview/text-shadow/
http://www.quirksmode.org/css/textshadow.html
http://www.standardista.com/sxsw/#slide9
word-break
Specifies line breaking rules for non-CJK (Chinese/Japanese/Korean) text
Example:
http://www.w3schools.com/cssref/tryit.asp?filename=trycss3_word-break
word-wrap
Allows long, unbreakable words to be broken and wrap to the next line
Example:
http://www.css3.info/preview/word-wrap/
Grid
grid-columns
Specifies the width of each column in a grid
grid-rows
Specifies the height of each column in a grid
Examples:
http://dev.w3.org/csswg/css3-grid-align
http://www.xanthir.com/blog/b4580
Multi-column
column-count
Specifies the number of columns an element should be divided into
column-fill
Specifies how to fill columns
column-gap
Specifies the gap between the columns
column-rule
A shorthand property for setting all the column-rule-* properties
column-rule-color
Specifies the color of the rule between columns
column-rule-style
Specifies the style of the rule between columns
column-rule-width
Specifies the width of the rule between columns
column-span
Specifies how many columns an element should span across
column-width
Specifies the width of the columns
columns
A shorthand property for setting column-width and column-count
Examples:
http://www.quirksmode.org/css/multicolumn.html
http://www.css3.info/preview/multi-column-layout/
Marquee
marquee-direction
Sets the direction of the moving content
marquee-play-count
Sets how many times the content move
marquee-speed
Sets how fast the content scrolls
marquee-style
Sets the style of the moving content
Examples:
http://www.css3.info/modules/css3-marquee-
module/
http://www.cssplay.co.uk/menu/css3-marquee.html
Ruby
ruby-align
Controls the text alignment of the ruby text and ruby base
contents relative to each other
ruby-overhang
Determines whether, and on which side, ruby text is allowed
to partially overhang any adjacent text in addition to its own
base, when the ruby text is wider than the ruby base
ruby-position
Controls the position of the ruby text with respect to its base
ruby-span
Controls the spanning behavior of annotation elements
Examples:
http://www.w3.org/TR/css3-ruby
http://www.storiesinflight.com/html5/ruby.html
User-Interface
appearance
Makes any element appear like a form element (e.g., paragraphs can look like buttons).
Examples:
https://developer.mozilla.org/en/CSS/-moz-appearance
http://davidwalsh.name/dw-content/webkit-styles.php
box-sizing
Forces an element fit inside an area.
Example:
http://css-tricks.com/examples/BoxSizing/
outline-offset
Offsets an outline, and draws it beyond the border edge
Example:
http://www.w3schools.com/cssref/tryit.asp?filename=trycss3_outline-offset
resize
Specifies whether or not an element is resizable by the user
Example:
http://www.css3.info/preview/resize/
User-Interface (continued)
nav-index
Specifies the tabbing order for an element
nav-down
Specifies the position of the element when using the arrow-down navigation key
nav-left
Specifies the position of the element when using the arrow-left navigation key
nav-right
Specifies the position of the element when using the arrow-right navigation key
nav-up
Specifies the position of the element when using the arrow-up navigation key
Example: Currently no browser supports the nav* properties
Content for Paged Media (print)
bookmark-label
Specifies the label of the bookmark
bookmark-level
Specifies the level of the bookmark
bookmark-target
Specifies the target of the bookmark link
Example:
http://www.w3.org/TR/css3-gcpm/#bookmarks
float-offset
Pushes floated elements in the opposite direction of the where they have been floated with float
Example:
http://www.w3.org/TR/css3-gcpm/#the-float-offset-property
image-resolution
Specifies the resolution of an image
Example:
http://dev.w3.org/csswg/css3-images/#image-resolution
marks
Adds crop and/or cross marks to the document
Example:
http://www.quackit.com/css/properties/css_marks.cfm
string-set
Named strings are created with the ‘string-set’ property which copies a string of text into the named string.
Only text is copied; not style, structure, or replaced content
Example:
http://www.w3.org/TR/css3-gcpm/#string-set
Content for Paged Media (print) -
continued
hyphenate-after
Specifies the minimum number of characters in a hyphenated word after the
hyphenation character
hyphenate-before
Specifies the minimum number of characters in a hyphenated word before the
hyphenation character
hyphenate-character
Specifies a string that is shown when a hyphenate-break occurs
hyphenate-lines
Indicates the maximum number of successive hyphenated lines in an element
hyphenate-resource
Specifies a comma-separated list of external resources that can help the browser
determine hyphenation points
hyphens
Sets how to split words to improve the layout of paragraphs
Example:
http://meyerweb.com/eric/css/tests/css3/show.php?p=hyphens
More Paged Media Properties
object-fit
Gives a hint for how to scale a replaced element if neither its width
nor its height property is auto
object-position
Determines the alignment of the object inside the box
Examples:
http://www.w3.org/TR/css3-images/#object-fit
http://www.w3.org/TR/css3-images/#object-position
image-orientation
Specifies a rotation in the right or clockwise direction that a user
agent applies to an image
Example:
http://dev.w3.org/csswg/css3-images/#image-orientation
size
Specifies the size and orientation of the containing box for page
content
Example:
http://dev.w3.org/csswg/css3-page/#page-size-prop
Speech
mark
A shorthand property for setting the mark-before and mark-after properties
mark-after
Allows named markers to be attached to the audio stream
mark-before
Allows named markers to be attached to the audio stream
phonemes
Specifies a phonetic pronunciation for the text contained by the corresponding
element
rest
A shorthand property for setting the rest-before and rest-after properties
rest-after
Specifies a rest or prosodic boundary to be observed after speaking an
element's content
rest-before
Specifies a rest or prosodic boundary to be observed before speaking an
element's content
Speech (continued)
voice-balance
Specifies the balance between left and right channels
voice-duration
Specifies how long it should take to render the selected element's content
voice-pitch
Specifies the average pitch (a frequency) of the speaking voice
voice-pitch-range
Specifies variation in average pitch
voice-rate
Controls the speaking rate
voice-stress
Indicates the strength of emphasis to be applied
voice-volume
Refers to the amplitude of the waveform output by the speech synthesizes
Examples:
http://www.css3.info/preview/speech/
http://dev.w3.org/csswg/css3-speech/
Linebox
alignment-adjust
Allows more precise alignment of elements
alignment-baseline
Specifies how an inline-level element is aligned with respect to its parent
baseline-shift
Allows repositioning of the dominant-baseline relative to the dominant-baseline
dominant-baseline
Specifies a scaled-baseline-table
drop-initial-after-adjust
Sets the alignment point of the drop initial for the primary connection point
drop-initial-after-align
Sets which alignment line within the initial line box is used at the primary connection point with the
initial letter box
drop-initial-before-adjust
Sets the alignment point of the drop initial for the secondary connection point
drop-initial-before-align
Sets which alignment line within the initial line box is used at the secondary connection point with the
initial letter box
drop-initial-size
Controls the partial sinking of the initial letter
drop-initial-value
Activates a drop-initial effect
Linebox (continued)
inline-box-align
Sets which line of a multi-line inline block align with the previous and next inline elements within a
line
line-stacking
A shorthand property for setting the line-stacking-strategy, line-stacking-ruby, and line-stacking-shift
properties
line-stacking-ruby
Sets the line stacking method for block elements containing ruby annotation elements
line-stacking-shift
Sets the line stacking method for block elements containing elements with base-shift
line-stacking-strategy
Sets the line stacking strategy for stacked line boxes within a containing block element
text-height
Sets the block-progression dimension of the text content area of an inline box
Example:
http://dev.w3.org/csswg/css3-linebox/#properties
Hyperlink
target
A shorthand property for setting the target-name, target-new, and
target-position properties
target-name
Specifies where to open links (target destination)
target-new
Specifies whether new destination links should open in a new window
or in a new tab of an existing window
target-position
Specifies where new destination links should be placed
Examples:
http://thinkvitamin.com/design/stay-on-target/
http://virtuelvis.com/gallery/css3/target/interface.html
http://www.uselesscode.org/blog/82/pure-css3-tab-widget
Some CSS3 Resources…
http://www.stanford.edu/group/ttsclasses/css/ http://msdn.microsoft.com/
http://border-radius.com/ http://quackit.com/css
http://caniuse.com/ http://quirksmode.org/css/contents.html
http://css-tricks.com/ http://standardista.com
http://css3.bradshawenterprises.com http://standardista.com/sxsw
http://css3.info/ http://storiesinflight.com/html5/ruby.html
http://cssplay.co.uk/menu/css3-marquee.html http://stubbornella.org/content/category/general/gee
k/css/
http://davidwalsh.name/dw-content/webkit-
styles.php http://thinkvitamin.com/design/stay-on-target/
http://dev.w3.org/csswg/ http://uselesscode.org/blog/82/pure-css3-tab-widget
http://fontsquirrel.com/ http://virtuelvis.com/gallery/css3/target/interface.htm
l
http://google.com/webfonts
http://w3.org/
http://hex2rgba.devoth.com/
http://w3schools.com
http://hslpicker.com/
http://westciv.com/tools/3Dtransforms
http://html5rocks.com/
http://xanthir.com/blog
http://leemunroe.com
http://xanthir.com/blog/b4580
http://meyerweb.com/eric/css/
http://selectivizr.com