30
Basic HTML

Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

  • View
    223

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Basic HTML

Page 2: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Guide to HTML code

• Not case sensitive

• Use tag for formatting output: new line, paragraph, text size, color, font type, etc.

• Can be a single or coupled tag

• Tag general format: Single: <tag_format>

Double: <tag_format> . . . </ tag_format>

Page 3: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Very simple HTML code<html>

<head>

<title>Simple HTML</title>

</head>

<body>

Hello World

</body>

</html>

Page 4: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

More complex code<html><head><title>More about HTML Text</title></head><body>This is a normal text<br><b>This is a text (bold)</b><br><i>This is a text (italic)</i><p><font face=“Arial” color=“#FF0000” size=+3>This is a text with font = Arial, size = 3, color = Red</font><p>Please set me to bold, italic, font = Arial, size = 3, color = Red<p><pre>This is apreformatted text</pre></body></html>

Page 5: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Image

<img src=“image file name” . . . >

Page 6: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

<a href=“reference object” . . . >linked object</a>

reference object :• Part of text in the same document• Other document• Image / animation / audio / video• Application logic (CGI script)• Client script (JavaScript / VBScript)

linked object :• Text• Image

Link

Page 7: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Table

Begin table

Begin row

Column1, Column2, . . .

End row

. . .

End table

Page 8: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

TableBegin table = <table . . . >End table = </table>

Begin row = <tr . . . >End row = </tr>

Column = <td . . . > column content </td>

column content : text, image, linked object, etc.

Page 9: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Table

Table with 2 rows & 3 columns for each

row:

<table border cols=3 rows=2 width=“100%”>

<tr><td>1</td><td>2</td><td>3</td></tr>

<tr><td>4</td><td>5</td><td>6</td></tr>

</table>

Page 10: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

More complex table #1

There are two rows:

<table>

<tr> . . .</tr>

<tr> . . .</tr>

</table>

Page 11: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

More complex table #1

First row -> two columns

Second row -> one column

<table>

<tr> <td>. . .</td> <td> . . . </td> </tr>

<tr> <td> . . . </td></tr>

</table>

Page 12: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

More complex table #1

Span two columns for the single column in the second row:

<table>

<tr> <td>. . .</td> <td> . . . </td> </tr>

<tr> <td colspan=“2”> . . . </td></tr>

</table>

Page 13: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

More complex table #2

There are two rows (max):

<table>

<tr> . . .</tr>

<tr> . . .</tr>

</table>

Page 14: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

More complex table #2

<table>

<tr> <td>. . .</td> <td>. . .</td> </tr>

<tr> <td>. . .</td> </tr>

</table>

Column: is the first column in the first row

Column: is the second column in the first row

Column: is the second column in the second row

Page 15: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

More complex table #2

<table>

<tr> <td rowspan=“2”>. . .</td> <td>. . .</td> </tr>

<tr> <td>. . .</td> </tr>

</table>

Span two rows for column:

Page 16: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

More complex table #3

It’s your turn ???

Page 17: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

FormBegin form

Form object components

End form

Page 18: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Form• Begin form = <form . . . >

• Form object components = Textfiled, Password, Hidden, TextArea, List Box (single/multiple), Radio Button, Check Box, Submit Button, Reset Button, Buttons

• End form = </form>

Page 19: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Form

<form method=“?” action=“?” …>

Form object components

</form>

Page 20: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Form object components

Textfield<input type=“text” name=“???” size=“???”>

Password<input type=“password” name=“???” size=“???”>

Hidden<input type=“hidden” name=“???”>

Page 21: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Form object components

TextArea

<textarea name=“???” rows=“???” cols=“???”>

Default textarea value

</textarea>

Page 22: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

List Box (single)

<select name=“???”>

<option value=“???”>Text 1

<option value=“???” selected>Text 2

. . .

</select>

Form object components

Page 23: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

List Box (multiple selection)

<select name=“???” multiple size=“???”>

<option value=“???”>Text 1

. . .

</select>

Form object components

Page 24: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Radio Button<input type=“radio” name=“r1” value=“v1”>Text 1

<input type=“radio” name=“r1” value=“v2” checked>Text 2

<input type=“radio” name=“r1” value=“v3”>Text 3

. . .

Check Box<input type=“checkbox” name=“c1” value=“v1”>Text 1

<input type=“checkbox” name=“c2” value=“v2” checked>Text 2

<input type=“checkbox” name=“c3” value=“v3”>Text 3

. . .

Form object components

Page 25: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Button, Submit, Reset

<input type=“button/submit/reset” value=“???”>

Form object components

Page 26: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Frame Object

• display multiple HTML doccument simultaneously in the same browser window

• Why use frame ?

• provide permanent navigation menu

Page 27: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Frame Object

• General Implementation

Begin set of frame

frame1

frame2

End set of frame

Page 28: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Frame ObjectBegin set of frame:<frameset rows / cols =“?, ?">

Frame:<frame src=“?" name=“?"> End set of frame:</frameset>

Page 29: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Frame Object

• Example

<frameset rows = “20%, *”>

<frame src=“?” name=“top”>

<frame src=“?” name=“bottom”>

</frameset>

Page 30: Basic HTML. Guide to HTML code Not case sensitive Use tag for formatting output: new line, paragraph, text size, color, font type, etc. Can be a single

Frame Object• Nested frame

<frameset rows = “20%, *”> <frame src=“?” name=“top”> <frameset cols = “25%, *”>

<frame src=“?” name=“bottom_left”>

<frame src=“?” name=“bottom_right”>

</frameset>

</frameset>