This presentation cannot be viewed in your browser.
For the best experience please use the latest Chrome, Safari or Firefox browser.
A glance into HTML5 and CSS3
Suresh Alse
Overview
HTML5 is the next major revision of the HTML standard superseding HTML 4.01, XHTML 1.0, and XHTML 1.1.
A cooperation between the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG) produced HTML5.
HTML5 is designed, as much as possible, to be backward compatible with existing web browsers. New features build on existing features and allow you to provide fallback content for older browsers.
Under HTML5's "umbrella"
Includes redefinitions of existing markup elements, and new elements that allow web designers to be more expressive in the semantics of their markup.
Loads of new technologies and APIs.
Additions to CSS spec
Basic HTML5 spec
The Doctype
For XHTML1.0 Strict:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
For HTML4 Transitional:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
For HTML5
<!doctype html>
The html element
In XHTML-based syntax, you’d be required to include an xmlns attribute. In HTML5 it is not required
In XHTML it is required to close tags like img, link, br, hr, input even though they do now contain child elements. In HTML5 it is optional. In HTML5 both of the following are valid.
<input type="text">
<input type="text" />
HTML5 Forms
Overview
HTML5 web forms have introduced new form elements, input types, attributes, and other features like form validation.
By eliminating the use of javascript, HTML5 not only makes marking up forms easier on the developer, it’s also better for the user. With client-side validation being handled natively by the browser, there will be greater consistency across different sites, and many pages will load faster without all that redundant JavaScript.
The "placeholder" AttributeIt allows a short hint to be displayed inside the form element
<input type="text" placeholder="Enter here" >
The "readonly" Attribute
<input type="text" value="readonly" readonly >
The "multiple" AttributeIf present, indicates that multiple values can be entered in a form control. Unlike in older HTML, In HTML5, it can be added to email and file input as well
<input type="file" multiple >
The "required" and "pattern" AttributesThe Boolean "required" attribute tells the browser to only submit the form if the field in question is filled out correctly.
<input type="text" required>
With the help of "pattern" attribute it is possible to set some rules on the input. Here is an example which takes in inputs with more than 6 characters. \S refers to “any nonwhitespace character,” and {6,} means “at least six times.”
<input type="text" required pattern="\S{6,}">
New Form Input Types
search: Not any different from a normal textbox apart from the styling.
email: Has builtin validation when "required" attribute is used.
url: Similar to email and has builtin validation.
tel: Telephone number. Unlike the url and email types, the tel type doesn’t enforce a particular syntax or pattern.
number: This is a “spinner” box, where you can either enter a number or click on the up or down arrows to select a number.
By far the most popular way to embed video and audio on web pages is by means of Adobe’s Flash Player plugin. The Flash Player plugin was originally developed by Macromedia and is now maintained by Adobe as a result of their 2005 buy-out of the company.
Before HTML5, there was no standard way to embed video into web pages. A plugin like Adobe’s Flash Player is controlled solely by Adobe, and is not open to community development.
With HTML5, there’s no need for the user to download third-party software to view your content, and the video or audio player is easily accessible via scripting.
Linear GradientLinear gradients are those where colors transition across a straight line: from top to bottom, left to right, or along any arbitrary axis.
background-image: linear-gradient( ... );
Inside those parentheses, you specify the direction of the gradient, and then provide some color stops.
For example:
ScaleThe scale(x,y) function scales an element by the defined factors horizontally and vertically, respectively.
transform: scale(1.5,0.25);
Hover here
RotationThe rotate() function rotates an element around the point of origin (as with scale,
by default this is the element’s center) clockwise, by a specified angle value.
transform: rotate(10deg)
Combining transformationsIt is possible to combine transformations by listing them after the other
SkewThe skew(x,y) function specifies a skew along the X and Y axes.
transform: skew(15deg, 4deg);
Skewed Text
transition-durationThe transition-duration property sets how long the transition will take. You can specify this either in seconds (s) or milliseconds (ms).
transition-duration: 0.2s;
transition-delayIt introduces a delay before the animation begins. Normally, a transition begins immediately, so the default is 0.