Web Development Prelim2
Web Development Prelim2
• HTML5 removes extra information required and you can use simply
following syntax.
HTML5 Basic Syntaxes
• The <link> tag – so far you were writing <link> as follows.
• HTML5 removes extra information required and you can use simply
following syntax.
HTML5 Basic Syntaxes
• HTML5 elements – are marked up using start tags and end tags. Tags
are delimited using angle brackets with the tag name in between.
The difference between start tags and end tags is that the latter
includes a slash before the name. Following is the example of an
HTML5 element.
• HTML5 tag names are case insensitive and may be written in all
uppercase or mixed case, although the most common convention is
to stick with lower case.
HTML5 Basic Syntaxes
• HTML5 attributes – elements may contain attributes that are used to
set various properties of an element. Some attributes are defined
globally and can be used on any element, while others are defined
for specific elements only. All attributes have a name and a value
and look like as shown below in the example. Following is the
example of an HTML5 attributes which illustrates how to mark up a div
element with an attribute named class using a value of “example”.
HTML5 Basic Syntaxes
• HTML5 Document
The following tags have been introduced for better structure
• section – this tag represents a generic document or application
section. It can be used together with h1-h6 to indicate the document
structure.
• article – this tag represents an independent piece of content of a
document, such as blog entry or newspaper article.
• aside - this tag represents a piece of content that is only slightly
related to the rest of the page.
HTML5 Basic Syntaxes
• header – this tag represents header of a section
• footer – this tag represents a footer for a section and can contain
information about the author, copyright information, etc.
• nav – this tag represents a section of the document intended for
navigation.
• dialog – this tag can be used to mark up a conversation
• figure – this tag can be used to associate a caption together with
some embedded content, such as graphic or video.
HTML5 Attributes
• Standard Attributes – the attributes
listed below are supported
by almost all the HTML5 tags.
HTML5 Attributes
HTML5 Attributes
Web Forms of HTML5
• Form elements and attributes in HTML5 provide a greater degree of
semantic mark-up than HTML4 and remove a great deal of the need
for tedious scripting and styling that was required in HTML4.
• The <input> element – has new values for the type attribute.
• search: the element represents search entry field. Line breaks are
automatically stripped from input value, but no other syntax is
enforced.
• tel: the element represents a control for editing a telephone number.
Line breaks are automatically stripped from the input value, but no
other syntax is enforced, because telephone numbers vary widely
internationally. You can use attributes such pattern and maxlength to
restrict values entered in the control.
Web Forms of HTML5
• url: the element represents a control for editing URL. Line breaks and
leading and trailing whitespaces are automatically stripped from the
input value.
• email: the element represents one email address. Line breaks are
automatically stripped from the input value.
Web Forms of HTML5
• The <input> element also has new attributes:
• list: the ID of a <datalist> element whose content, <option> elements,
are to be used as hints and are displayed as proposals in the
suggestion area of the input field.
• pattern: a regular expression that the control’s value is checked
against, which can be used with type value of text, tel, search, url
and email.
• form: a string indicating which <form> element this input is part of an
input can only be in one form.
• formmethod: a string indicating which HTTP method (GET or POST)
should be used when submitting.
Web Forms of HTML5
• Text input – this segment define a one line input the user can enter
into the box (textbox).
Web Forms of HTML5
• Checkboxes – this section allows the user to select multiple options to
choose from a limited numbers of options.
Web Forms of HTML5
• Radio <input> element
Reference
• W3schools
HyperText Markup Language
• Beginning Web Programming with HTML, XHTML, and CSS
Ducket, J, (2011). John Wiley & Sons