1. Trang chủ
  2. » Công Nghệ Thông Tin

Lập trình HTML cơ bản đến nâng cao html

94 282 1

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 94
Dung lượng 1,1 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

• 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 1

HTML

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 10

HTML 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 14

HTML 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 16

Line 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 18

Horizontal 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 20

Font 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 22

Bold, 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 24

Other elements used for text

formatting

Figure 5: Pre, tt and cite tag

Trang 25

Other elements used for text

formatting

Figure 6: del, big, small, sub and sup tag

Trang 26

Other elements used for text formatting

Figure 7: dfn, code, samp, kbd and var tag

Trang 27

Other 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 29

Unordered 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 31

Ordered 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 33

Definition 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 35

Nested 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 37

Adding 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 38

Adding 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 40

General 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 44

Internal 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 48

Creating Image Map

Trang 49

Creating Image Map

• Example:

Figure 15: Example of creating image map

Trang 50

Creating Image Map

Trang 51

Creating Image Map

Figure 16: Code of creating image map 2

Trang 52

Creating 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 54

Creating table

<table> : create table.

<tr> : create row.

<td> : create column.

Trang 55

Creating 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 57

Table structure

Trang 58

Table structure

Figure 20: Using <th> tag, “rowspan”,”colspan” attribute

Trang 59

Table structure

Figure 21: Using <thead> and <tfoot> tag

Trang 60

Table structure

Trang 61

Table 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 63

Table attributes

Figure 24: Table attributes

Trang 64

Table attributes

Figure 25: Using “width”, “cellspacing”, “frame”, “rule”

Trang 65

• DIV and SPAN

• HTML object and param

• Reference

Trang 66

HTML 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 68

Form – Input elements

Figure 27: Attribute of the <input> tag

Trang 69

Form – 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 70

Form – 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 71

Form – 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 73

Other 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 75

New 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 77

Inline 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 78

Inline 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 80

The 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 82

The 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 84

The 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 86

HTML <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 87

HTML <object> - embedding media

Trang 88

HTML <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 90

Attributes 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 92

Attributes 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 94

Reference

Ngày đăng: 30/10/2015, 15:24

TỪ KHÓA LIÊN QUAN

w