• Forms and Input• New Form elements and attributes in HTML5 • CSS – Cascading Style Sheets in HTML • DIV and SPAN • HTML object and param • Reference... • Forms and Input• New Form elem
Trang 1HTML
Trang 2• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 3• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 5• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 7• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 9• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 10HTML Heading
Figure 1: HTML Heading
Trang 11• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 13• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 14HTML Paragraph
Figure 2: HTML Paragraph
Trang 15• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 16Line break
Figure 3: Line break
Trang 17• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 18Horizontal rule
Figure 4: Horizontal rule
Trang 19• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 20Font element
• Attribute face:
– Syntax: <font face="typeface">text</font>
– Example: <font face=“Arial Black”>abc</font>
• Attribute size
– Syntax: <font size="value">text</font>
– Example: <font size=“1”>abc</font>
• Attribute color
– Syntax: <font color="a_color">text</font>
– Example: <font color=“red”>abc</font>
Trang 21• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 22Bold, italic, underline and other
Trang 23• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 24Other elements used for text
formatting
Figure 5: Pre, tt and cite tag
Trang 25Other elements used for text
formatting
Figure 6: del, big, small, sub and sup tag
Trang 26Other elements used for text formatting
Figure 7: dfn, code, samp, kbd and var tag
Trang 27Other elements used for text formatting
Figure 8: q, blockquote and address tag.
Trang 28• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 29Unordered Lists
Trang 30• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 31Ordered Lists
Trang 32• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 33Definition Lists
Figure 11: Definition Lists
Trang 34• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 35Nested Lists
Figure 12: Nested Lists
Trang 36• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 37Adding images
• Image format: GIF, JPEG, PNG, BMP, TIFF, PCX
• Element: <img>…</img>
• Attribute:
src: Location of image file.
alt: alternate text.
align: Bottom, Middle, Top, Left, Right.
width: image length in pixels.
height: image height in pixels
hspace, vspace.
Trang 38Adding images
Figure 13: Adding images
Trang 39• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 40General syntax
<a href=“url” title=“Link title”>Link text</a>
• href : specifies the destination of a link
• url : the address of the link
• title : specifies a title for the hyperlink
• Link text : text that appears in the web page
Trang 41• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 43• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 44Internal link
• Allow to jump to another section on web page
• To create internal link:
Trang 45• HTML Tables
• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 46• Image-map is image with clickable areas.
Figure 14: Image map 1
Trang 47• HTML Tables
• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 48Creating Image Map
Trang 49Creating Image Map
• Example:
Figure 15: Example of creating image map
Trang 50Creating Image Map
Trang 51Creating Image Map
Figure 16: Code of creating image map 2
Trang 52Creating Image Map
Figure 17: Displaying of code
Trang 53• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 54Creating table
<table> : create table.
<tr> : create row.
<td> : create column.
Trang 55Creating table
Figure 18: Creating table
Trang 56• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 57Table structure
Trang 58Table structure
Figure 20: Using <th> tag, “rowspan”,”colspan” attribute
Trang 59Table structure
Figure 21: Using <thead> and <tfoot> tag
Trang 60Table structure
Trang 61Table structure
Figure 23: Table with caption, thead and tbody
Trang 62– Table attributes
• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 63Table attributes
Figure 24: Table attributes
Trang 64Table attributes
Figure 25: Using “width”, “cellspacing”, “frame”, “rule”
Trang 65• DIV and SPAN
• HTML object and param
• Reference
Trang 66HTML Form
• Definition:
– HTML forms are used to pass data to server.
– HTML forms can be used with script language.
Figure 26: Attributes of <form> tag
Trang 67– Form – Input Elements
– Other form elements
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 68Form – Input elements
Figure 27: Attribute of the <input> tag
Trang 69Form – Input elements
• Text field
– Usage: define a one-line input field to enter text
– Syntax: <input type=“text” name=“t1”>
• Password field
– Usage: like text field, but characters are masked
– Syntax: <input type=“password” name=“p1”>
• Checkbox
– Usage: let a user select one or more options
– Syntax: <input type=“checkbox” name=“c1” value=“v1”>
Trang 70Form – Input elements
• Radio
– Usage: let a user select only one option.
– Syntax: <input type=“radio” name=“r1” value=“v1”>
• File
– Usage: is used for file upload.
– Syntax: <input type=“file” name=“f1”>
• Simple button
– Usage: often used to active a JavaScript function.
– Syntax: <input type=“button” value=“Click here”>
Trang 71Form – Input elements
• Submit button
– Usage: is used to send form data to server
– Syntax: <input type=“submit” value=“Send”>
• Image for submit button
– Usage: like submit button, but use image
– Syntax: <input type=“image” src=“p.jpg” alt=“submit”>
• Reset button
– Usage: reset all form fields
– Syntax: <input type=“reset” value=“Reset”>
Trang 72– Other form elements
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 73Other form elements
Trang 74• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 75New Form elements and attributes in
HTML5
• HTML5 new Input types
• New attributes for <form> added in HTML5
• New input attributes
• Other new Form elements in HTML5
Trang 76• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
– Inline style
– Internal Style Sheet – External Style Sheet – Special selectors
• DIV and SPAN
• HTML object and param
• Reference
Trang 77Inline style
• Definition:
– Is CSS rule placed directly within HTML tag.
– It is placed in style attribute.
• Syntax:
<tag style="property1:value; property2:value; ">
Content
</tag>
Trang 78Inline style
• Example:
– Set the color and alignment for <h2> heading
Figure 44: Style for <h2> heading
Trang 79• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
– The DIV tag
– The SPAN tag – The difference between DIV and SPAN
• HTML object and param
• Reference
Trang 80The DIV tag
Figure 47: Example of DIV tag
Trang 81• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
– The DIV tag
– The SPAN tag
– The difference between DIV and SPAN
• HTML object and param
• Reference
Trang 82The SPAN tag
Trang 83• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
– The DIV tag – The SPAN tag
– The difference between DIV and SPAN
• HTML object and param
• Reference
Trang 84The difference between
DIV and SPAN
Trang 85• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
– HTML <object> embedding media
-– Attributes of the object tag – Attributes of the param tag
• Reference
Trang 86HTML <object> - embedding media
• Used to embed media content on a web page.
• Partially supported in all major browsers.
• If the object is not displayed, the code in
<object> and </object> will be excuted.
Trang 87HTML <object> - embedding media
Trang 88HTML <object> - embedding media
• Embed a SWF file
<object type="application/x-shockwave-flash"
data="games/cubilus.swf" width="500" height="250">
<param name="src" value="games/cubilus.swf" />
<param name="bgcolor" value="#fbfbfe" />
Your browser not support SWF.
</object>
• Embed a WAV file
<object type="audio/x-wav" data="dir/test.wav" width="200"
height="20">
<param name="src" value="dir/test.wav" />
<param name="autoplay" value="false" />
<param name="autoStart" value="false" />
Alt : <a href="dir/test.wav" title="WAV file">test.wav</a>
Trang 89• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
– HTML <object> embedding media
-– Attributes of the object tag
– Attributes of the param tag
• Reference
Trang 90Attributes of the HTML object tag
Figure 50: Attributes of HTML object tag
Trang 91• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
– HTML <object> embedding media – Attributes of the object tag
-– Attributes of the param tag
• Reference
Trang 92Attributes of the param tag
Figure 51: Attributes of param tag
Trang 93• Forms and Input
• New Form elements and attributes in HTML5
• CSS – Cascading Style Sheets in HTML
• DIV and SPAN
• HTML object and param
• Reference
Trang 94Reference