20
1 Review of HTML Elements

1 Review of HTML Elements. 2 The tag These tags are marked as comments in HTML. Any text between these two comment tags will

Embed Size (px)

Citation preview

Page 1: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

1

Review of HTML Elements

Page 2: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

2

The <!-- --> tag

<!--

Text_to_comment -->

These tags are marked as comments in HTML. Any text between these two comment tags will not be displayed in the user’s browser window.

Page 3: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

3

The <br> tag

<br> This tag tells the browser to add a line break to

the current page.

Page 4: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

4

The <img> tag

<img> tag Tells the browser to include an image into the

current page.

<img src=“file.jpg” alt=“my picture” width=“20” height=“20”>

<img src=“file.jpg” alt=“my picture” width=“20%” height=“20%”>

Page 5: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

5

The <img> tag

src Sets the source URL for the image. This parameter is required.

alt Sets the alternative text for the image. If the current browser is incapable of

displaying image, this text will be displayed instead. width

Sets the width of the image. Two possible values can be set for this parameter. One is number that sets the width of the image in pixels. The other is a % that sets the width of the image as a % of the curent browser viewscreen.

height Sets the height of the image. Two possible values can be set for this

parameter. One is number that sets the height of the image in pixels. The other is a % that sets the height of the image as a % of the curent browser viewscreen.

If you do not use height and width attributes the image will be displayed by its default size.

Page 6: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

6

The <hr> tag

<hr> tag used in between <body> </body> tags. <hr> tag

Displays a horizontal line accross the page. The horizontal line will be displayed in pseudo 3D. The appearance of the line varies according to the browser used.

<hr width=“20” size=5 align=“center” color=“#FF0000”> <hr width=“20” size=5 align=“center” noshade> <hr width=“20%” size=5 align=“left”>

Page 7: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

7

The <hr> tag

align sets the horizotal alignment of the horizontal rule. Possible

parameters: center,left,right color

sets the color of the horizontal rule. noshade

removes the pseudo 3D shading from the horizontal rule. Size

Sets the size of the horizontal rule in pixels. Width

Sets the width of the horizontl rule. The possible values for this parameter can either be a number or a percent. A number sets the horizontal rule width in pixels. A number followed by a % sets the horizontal width to a % relative to the size of the browser display.

Page 8: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

8

The <a></a> tag <a> tag used in between <body> </body> tags.

<a href=“http://remote_addr”>Text_to_be_displayed</a>

href Tells the browser the target URL of the hyperlink

Tag <a></a> The <a> tag defines either a hyperlink that allows a browser to

jump to another page, or it defines a bookmark. HREF or NAME parameter is required.

Page 9: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

9

The <a></a> tag

<a href=“current_folder_file.htm” target=“_blank”>Text_to_be_displayed </a>

target Tells the browser which frame to jump to.

_blank :means open a new browser window. _self : means use the currenct window (and if exists current frame)

Page 10: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

10

The <a></a> tag

<a href=“mailto:[email protected]”>Text_to_be_displayed </a>

href Starting with mailto: When someone clicks this type of anchored link, most browsers lnch the

default e-mail program.

Page 11: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

11

The <a></a> tag

<a name=“id_given”>Text_to_be_focused</a> Later/before somewhere to focus on this item

<a href=“#id_given”>Text_to_focus</a>

name This parameter sets the current location as a bookmark using the indicated

name.

It is possible to focus to some location in a remote file. <a href=“http://remoteaddress#id_in_the_file”>

Text_to_focus </a>

Page 12: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

12

The <table></table> tag

<table> </table> tag places a table onto the page.

<table width=“20%” border=“1”> </table>

border Sets the width of the border in pixels. If it is not set, the border

around the table will be transparent.

Width Sets the width of the table. The possible values for this parameter

can either be a number or a percent. A number sets the table width in pixels. A number followed by a % sets the table width to a % relative to the size of the browser display.

Page 13: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

13

The <tr></tr> tag

Used in between <table> </table> tags. <tr></tr> tag

Indicates a row in a table. <table>

<tr align=“center” valign=“Bottom”> </tr> <tr align=“center” valign=“center”> </tr>

<table>

align Sets the horizontal alignment of the table row. Possible parameters:

center,left,right. Valign

Sets the vertical alignment of the table row. Possible parameters: baseline,bottom,center,top.

Page 14: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

14

The <td></td> tag

Used in between <tr> </tr> tags. <td></td> tag

Is used to specify a element of a table.

<table> <tr> <td align=“center” height=“20” width=“80%”> one</td> <td valign=“center” height=“20” width=“20%”>two</td> <td nowrap height=“20” width=“20%”>three</td> </tr> </table>

Page 15: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

15

The <td></td> tag

align Sets the horizontal alignment of the table data. The

possible values can be : center,left,right. height

Sets the height of the table element. width

Sets the width of the table element. valign

Sets the vertical alignment of the table element. The possible values for this parameter are: baseline,bottom,center,top.

nowrap İs used when the browser should not wrap text.

Page 16: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

16

The <td></td> tag <table border=1> <tr> <td> One</td><td>Two</td><td>Three</td> </tr> <tr> <td colspan=“3”>Four</td> </tr> <tr> <td colspan=“2”>Five</td> <td >Six</td> </tr> </table>

Output: One Two Three

Four

Five Six

Page 17: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

17

The <td></td> tag

colspan Sets the number of columns that this table

element should span

Page 18: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

18

The <td></td> tag <table border=1> <tr> <td> One</td><td rowspan=“3”>Two</td><td>Three</td> </tr> <tr> <td>Four</td><td rowspan=“2”>Five</td> </tr> <tr> <td >Six</td> </tr> </table>

Output: One Two Three

Four Five

Six

Page 19: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

19

The <td></td> tag

rowspan Sets the number of rows that this table element

should span.

Page 20: 1 Review of HTML Elements. 2 The tag  These tags are marked as comments in HTML. Any text between these two comment tags will

20

The <th></th> tag

Used in between <tr> </tr> tags.

<th></th> tag Is used to set a table heading element in a table.

This command is identical to the <td>, except the text between the start <th> and the end </th> tag is boldfaced.