Professional Documents
Culture Documents
HTML
HTML
HTML xHTML
ITEC Bayon Hosting
Bayon Hosting
Notepad
-
Hello World!
o
o
File Save
File Name: extension .html
Structure of HTML
structure HTML file
<html>
<head>
</head>
<body>
</body>
</html>
<head> : element <title>, <meta>, <style>, <script>, <link>
<body> : element page <hn>,
<b>,<hr>,<img>,<pre>
General Tags
<title> tag
element page title Title bar
syntax:
<head>
<title> Title Here </title>
</head>
Bayon Hosting
<hn> tag
element n 1-6
page
Syntax:
<hn align="left|right|center|justify"> content </hn>
<h1>Hello
<h2>Hello
<h3>Hello
<h4>Hello
<h5>Hello
<h6>Hello
World</h1>
World</h2>
World</h3>
World</h4>
World</h5>
World</h6>
White Space
white space
Enter, tab, space
<body>
Hello
World!
Welcome to
ITEC Center
</body>
Element Component
Element open tag attributes
closing tag Element elements
Tags
Tag element
(< >) tag
Open tag(<tag>) Closing Tag(</tag>)
Example:
<html> </html>
<h1> </h1>
<tag> closing tag tag self-closing element
replaced element <img>, <br>, <hr>,<meta>
Attribute
Attribute element Attribute Attribute
Name Attribute Value
tags attribute
Bayon Hosting
Core Attribute
Example:
<h1 title="Heading Text">Hello World!</h1>
<h1 style="color:red"> Hello World!</h1>
Language Attribute
dictionary index
Example:
<h1 dir="rtl" lang="en"> Hello World!</h1>
onclick
ondblclick
onmousedown
onmouseup
onmouseover
onmousemove
onmouseout
onkeypress
onkeydown
onkeyup
Example:
<h1 onclick="alert('Hello')">Hello World</h1>
element
attribute value
Open Tag
Affected Area
Closing Tag
Bayon Hosting
More Tags
<br />
Line Break
Syntax:
<br clear="left|right|all" />
Example:
Hello <br />
World
<p>
paragraph paragraph paragraph
blank line
Syntax:
<p align=left|center|right|justify>
<p title=Paragraph 1> Hello World Hello World Hello World Hello World
Hello World Hello World Hello World Hello World Hello World Hello World
Hello World Hello World Hello World Hello World Hello World Hello World
Hello World Hello World Hello World Hello World </p>
<p title=Paragraph 2 align=center> Hello World Hello World Hello World
Hello World Hello World Hello World Hello World Hello World Hello World
Hello World Hello World Hello World Hello World Hello World Hello World
Hello World Hello World Hello World Hello World Hello World </p>
<p title=Paragraph 3 align=right> Hello World Hello World Hello World
Hello World Hello World Hello World Hello World Hello World Hello World
Hello World Hello World Hello World Hello World Hello World Hello World
Hello World Hello World Hello World Hello World Hello World </p>
<p title=Paragraph 4 align=justify> Hello World Hello World Hello World
Hello World Hello World Hello World Hello World Hello World Hello World
Hello World Hello World Hello World Hello World Hello World Hello World
Hello World Hello World Hello World Hello World Hello World </p>
Font
Syntax:
<font face=font-family size=n color=color-code | color-name>
face:
: Limon S1, Limon S2 font
font font
size:
1-7, -1 -7, +1 +7
1-7
+1 - +7 relative size 3 +3 actual size 6
<font size="5">Hello
<font size="+5">Wolrd!</font> from ITEC Center</font>
Bayon Hosting
Color:
color-code #rrggbb colorname red, blue, green
Text-Style
Text Style
Tag
bold
<b>,<strong>
italic
<i>,<em>
Underline
<u>,<ins>
strike
<strike>,<s>,<del>
big
<big>
small
<small>
superscript
subscript
<sup>
<sub>
Horizontal Rule
<hr size=n width=n,n% align=left|center|right noshade=noshade
color=color" />
<hr />
<hr noshade="noshade" />
<hr size="5" />
<hr size="5" width="50%" />
<hr align="right" width="50%" size="5" />
<blockquote>
element text blockquote
line
Syntax:
<blockquote cite=url> Someones statements, Passage </blockquote>
url: location online source document
Example:
Jim said:
<blockquote> I will go to Cambodia next month with his family. I will
visit my relative at the weekend.</blockquote>
Jim also dare his girl friend to come with too.
Bayon Hosting
<q>
q=quote element text quote
line element
Syntax:
Element Type
elements box Box
Inline Elements
elements elements box
content Inline elements <b>, <i>, <strike>, <s>, <del>, <ins>, <u>,
<strong>,<span>
Block Elements
elements elements box
contents parent elements
Block elements <p>, <blockquote>, <center>, <div>
<head>
<title>Untitled Document</title>
<style>
*{
border:1px solid;
}
</style>
</head>
<body>
Bayon Hosting
<p>
The paragraph is block elements so it's width will be equal to it's
container width is <body> and the follow elements width just it's
contents <strong> Strong Text </strong>, <em> Emphasis Text </em>, <del>
deleted Text </del>.
</p>
<div> division tag will have it own line </div>
This <span> span </span> will be with other text
</body>
<center>
element align content
<div align="center">
element
Syntax:
<center> Affected Content </center>
Example:
<center> This text will be center </center>
Special Character
character browser HTML page
Bayon Hosting
: ©
Preformatted Text
<pre>
element
text
<p> here is the javascript example</p>
<pre>
<script type=text/javascript>
document.write(Hello, World!)
</script>
</pre>
Phrase Element
<code>
document program statment, keywords...
<P> declare a variable in JavaScript with the <CODE>var</CODE> keyword.</P>
<samp>
element text output computer program script
<P>When you click on its, you will see <SAMP>Hello, world!</SAMP>on the
screen.</P>
<var>
element text varaible computer program
<p> the value of <var> iNum </var> will be 20 </p>
<kbd>
element text user keyboard text field.
<P>If you agree with answer, type <KBD>YES</KBD> into the text box.</P>
<abbr>
title attribute search engine, screen reader
Syntax:
<abbr title=Full Words> abbreviation word </abbr>
Example:
Hello <abbr title=Doctor> Dr. </br> Ann Michel.
<acronym>
abbr acronym
<address>
page authors contact information
Syntax:
<address> Address Info </address>
Bayon Hosting
Example:
<address>
<P>Send comments to: titdara@hotmail.com
</P>
</ADDRESS>
<bdo>
bdo=BiDirectional Override
text dir attribute
Syntax:
<bdo dir=rtl|ltr> Affected Content </bdo>
Exampe:
<bdo dir=rtl> Hello World! </bdo>
<cite>
cite=citation
reference content
Syntax:
<cite> Reference Info </cite>
Example:
<P>Angkor waw built in 1113(<CITE>Khmer History Books</CITE>)</P>
<dfn>
dfn=definition
document
Syntax:
Comment
Browser
HTML
Syntax:
<!-- Comments Here -->
color="color"
face="font family"
size="1-7"
/>
Hello
<basefont face="courier new" size="5" color="#000099" />
Hello World!
10
<body>
Syntax:
<body background= background
bgcolor= background
bgproperties=fixed background scroll
text=
leftmargin= content browser
topmargin= content browser
link= link
alink= link
vlink= link
>
Internet Explorer :
leftmargin margin
topmargin margin
Fire Fox
leftmargin margin
rightmargin margin
topmargin margin
bottommargin margin
marginheight margin
marginwidth margin
URL
URL: Uniform Resource Locator
file URL
Bayon Hosting
11
Bayon Hosting
Absolute URL
Absolute URL: scheme (protocol), Server Name, path
Example:
http://www.microsoft.com/mcp/login/login.aspx
scheme
server name
path to file
http://www.microsoft.com:8080/mcp/login/login.aspx
scheme
server name
port
path to file
Protocols
80 for http
443 for https
21 for ftp
Port
Relative URL
file current file folder
manufacturer.html url="manufacturer.html"
global.js url = "javascript/global.js"
1.jpg url = "../images/1.jpg
12
Bayon Hosting
13
Module 2: Images
Bayon Hosting
Module 2: Images
Syntax
<img
src=url
Border=n
Alt=alternate text
Width=x,x%
Height=x,x%
align=left,right
Hspace=x
Vspace=x
longdesc=url
/>
Attribute Name
Src:
Description
Alt
Source
load
Border:
border pixels
Width=x
pixels
Height=x
pixels
Align=[left|right]
wrap( )
Hspace=x
Vspace=x
src=angkor.jpg
Border=1
Alt=Angkor Picture, North East at the Enter side
/>
/>
src=angkor.jpg
border=1
alt=Angkor Picture, North East at the Enter side
align=left
14
Module 2: Images
Bayon Hosting
Description
right
all
15
Module 3: Lists
Bayon Hosting
Module 3: Lists
Order Lists
<ol type=1|i|I|a|A start=n>
<li type="1|i|I|a|A" value="n"> List Item </li>
<li type="1|i|I|a|A" value="n"> List Item </li>
<li type="1|i|I|a|A" value="n"> List Item </li>
</ol>
Example 1:
<p>HTML Lesson:</p>
<ol>
<li>Lesson 1: HTML Basic</li>
<li>Lesson 2: Images</li>
<li>Lesson 3: Lists</li>
</ol>
Example 2:
<p>HTML Lesson:</p>
<ol type="I" start="10">
<li>HTML Basic</li>
<li>Images</li>
<li>Lists</li>
</ol>
Example 3:
<p>HTML Lesson:</p>
<ol type="I">
<li>HTML Basic</li>
<li type="i">Images</li>
<li type="a" value="5">Lists</li>
</ol>
Unorder Lists
list bulletin circle, disc, square
Syntax:
16
Module 3: Lists
</ul>
Example 1:
<h1>Food Type:</h1>
<ul>
<li>Fruit</li>
<li>Vegetable</li>
<li>Meat</li>
</ul>
Example 2:
<h1>Food Type:</h1>
<ul>
<li>Fruit</li>
<ul>
<li>Apple</li>
<li>Mango</li>
</ul>
<li>Vegetable</li>
<ul>
<li>Salad</li>
<li>Cabbage<li>
</ul>
<li>Meat</li>
<ul>
<li>Beef</li>
<li>Pork</li>
</ul>
</ul>
Definition Lists
definition list document dl, dt, dd list tag dl
Syntax:
<dl>
<dt> Defintion Term</dt>
<dd> Defition Data </dd>
<dt> Defition Term</dt>
Bayon Hosting
17
Module 3: Lists
</dl>
DL: Definition List
DT: Definition Term
DD: Definition Data
Example:
<h1>Definition List</h1>
<dl>
<dt>dl</dt>
<dd>Definition List</dd>
<dt>dt</dt>
<dd>Definition Term</dd>
<dt>dd</dt>
<dd>Definition Data</dd>
</dl>
Bayon Hosting
18
Module 4: Links
Bayon Hosting
Module 4: Links
Links WWW.
destination URL
user link
link page link
web pages
destination
label text
Description
_blank
_self
_parent
_top
19
Module 4: Links
href
Bayon Hosting
Creating Anchors
anchor
page
anchor
Create an anchors
<a name=anchor_name></a>
Images Maps
image map
<map> tag
<map name=map_name />
<area> tag
<area shape=rect|circle|poly|default
cords=coordinate
href=URL|nohref
target=target_option
accesskey=character
/>
cords shape
20
Module 4: Links
Bayon Hosting
shape=rect cords=left,top,right,bottom
shape=default cords
link
link
vlink
alink
download
21
Module 5: Tables
Module 5: Tables
Tables rows cell HTML table
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
<table>: table
<tr>: row table
<td><th>: cell table <th>
Example:
<table>
<tr>
<td>One</td>
<td>Two</td>
<td>Three</td>
</tr>
<tr>
<td>Four</td>
<td>Five</td>
<td>Six</td>
</tr>
<tr>
<td>Seven</td>
<td>Eight</td>
<td>Nine</td>
</tr>
</table>
Bayon Hosting
22
Module 5: Tables
Adding a Border
<table border=n>
</table>
Example:
<table border=1>
<tr>
<td>One</td>
<td>Two</td>
<td>Three</td>
</tr>
<tr>
<td>Four</td>
<td>Five</td>
<td>Six</td>
</tr>
<tr>
<td>Seven</td>
<td>Eight</td>
<td>Nine</td>
</tr>
</table>
Bayon Hosting
23
Module 5: Tables
</table>
Example:
<table border=10 width=50%>
</table>
Bayon Hosting
24
Module 5: Tables
<td>Six</td>
</tr>
<tr>
<td>Seven</td>
<td>Eight</td>
<td>Nine</td>
</tr>
</table>
</table>
Bayon Hosting
25
Module 5: Tables
Bayon Hosting
</colgroup>
Syntax: col
<col
span=n
align=left|right|center|justify
valign=top|middle|bottom|baseline
26
Module 5: Tables
Bayon Hosting
width=n
/>
Example
<table border="1">
<colgroup align="right" width="200"></colgroup>
<colgroup span="3">
<col span="2" align="center" width="100" />
<col align="left" width="150" />
</colgroup>
<tr>
<th><br /></th>
<th>Kits</th>
<th>Adults</th>
<th>Total</th>
</tr>
<tr>
<th>Hawley</th>
<td>2</td>
<td>4</td>
<td>6</td>
</tr>
<tr>
<th>Becket</th>
<td>5</td>
<td>22</td>
<td>27</td>
</tr>
<tr>
<th>Worthington</th>
<td>7</td>
<td>5</td>
<td>12</td>
</tr>
</table>
table format
27
Module 5: Tables
row
table
<thead>...</thead>
<tbody>...</tbody>
<tfoot>...</tfoot>
Example:
<table border="1">
<thead style="background:green">
<tr>
<th><br /></th>
<th>Kits</th>
<th>Adults</th>
</tr>
</thead>
<tbody style="background:yellow">
<tr>
<th>Hawley</th>
<td>2</td>
<td>4</td>
</tr>
<tr>
<th>Becket</th>
<td>5</td>
<td>22</td>
</tr>
<tr>
<th>Worthington</th>
<td>7</td>
<td>5</td>
</tr>
</tbody>
<tfoot style="background:blue">
<tr>
<th>total</th>
<td>14</td>
<td>29</td>
</tr>
</tfoot>
</table>
Bayon Hosting
28
Module 5: Tables
void: border
above: border
below: border
hsides:
vsides:
lhs:
rhs:
box, border:
area
none:
Bayon Hosting
29
Module 5: Tables
Bayon Hosting
<tfoot>
<tr>
<th>total</th>
<td>14</td>
<td>29</td>
</tr>
</tfoot>
</table>
<td nowrap=nowrap></td>
<th nowrap=nowrap></td>
30
Module 6: Frames
Bayon Hosting
Module 6: Frames
Frame user page Frame web
page window
rows=r1,r2
cols=c1,c2
>
<frame src=url name=frame_name>
<frame src=url name=frame_name>
</frameset>
Key
Description
frameset
rows
rows pane
cols
rows pane
r1,r2
row pixel %
c1,c2
col pixel %
<frame>
frame
src
file
frame
name
frame
target link
<frameset rows="100,*">
<frame src="banner.html" />
<frame src="content.html" />
</frameset>
31
Module 6: Frames
Bayon Hosting
Combining Frameset
frameset frameset frameset
frame
Example:
<frameset rows="100,*">
<frame src="banner.html" name="banner" />
<frameset cols="150,*">
<frame src="sidebar.html" name="sidebar" />
<frame src="content.html" name="content" />
</frameset>
</frameset>
32
Module 6: Frames
Bayon Hosting
Frame Attributes
frame attributes
Attribute
marginwidth:
Description
marginheight
frame pixel
frameborder=0| 1|
yes| no
frame border
bordercolor
border frame
scrolling =
auto|yes|no
noresize =
noresize
scrollbar frame
frame pixel
user frame
frameset attribute
Attribute
frameborder=0| 1|
yes| no
Description
border
border frame
bordercolor
border frame
frame border
Example:
<frameset rows="100,*" bordercolor="#FF9900">
33
Module 6: Frames
<noframe>...</noframe>
browser support frameset <noframe> tag
</noframe>
Example:
<frameset rows="100,*" bordercolor="#FF9900">
<frame src="banner.html" name="banner" noresize="noresize" />
<frameset cols="150,*" border="0">
<frame src="sidebar.html" name="sidebar" />
<frame src="content.html" name="content" marginheight="40"
marginwidth="10" scrolling="no"/>
</frameset>
</frameset>
<noframes> You need a frame-capable browser.</noframes>
Bayon Hosting
34
Module 7: Forms
Bayon Hosting
Module 7: Forms
form element
Form
page user
form form element textbox, radio buttons, checkboxes, drop-down menus, text
areas, button field name attribute
process
Creating a Form
Forms
Syntax:
<form method=post|get action=url>
...
</form>
Method post get get method
security
>
Attribute
type=text
type=text
name=text_box_name
value=default_value
size=n
maxlength=n
Description
text box
35
Module 7: Forms
Bayon Hosting
name
form element
value
size
textbox
maxlength
Name:
Password:
<textarea> tag
Syntax:
<textarea
name=fieldname
rows=n
cols=n
wrap=wrap
readonly=readonly
>
Default Text to view
</textarea>
Description
Attribute
name
form element
rows
cols
textarea
36
Module 7: Forms
Bayon Hosting
readonly
type=radio
name=fieldname
value=fieldvalue
checked=checked
/>
checked
default
value
user radio button
<form action="register.php" method="post">
Gender:
<input type="radio" value="male" name="sex" checked="checked" />Male
<input type="radio" value="female" name="sex" checked="checked"
/>Female
</form>
Create checkboxs
Syntax:
checkbox user
<input
type=checkbox
name=fieldname
value=fieldvalue
checked=checked
/>
checked
default
value
user radio button
Example:
<form action="register.php" method="post">
Your habbit:<br />
<input type="checkbox" value="football" name="sex" checked="checked"
/>Play Football<br />
<input type="checkbox" value="tennis" name="sex" />Play Tennis<br />
37
Module 7: Forms
Bayon Hosting
38
Module 7: Forms
Bayon Hosting
<optgroup> tag
<optgroup>
method=post
action=register.php
enctype=multipart/form-data
>
<input
type=file
name=fieldname
size=n
/>
</form>
size=n: file field character
get method upload file
Example:
39
Module 7: Forms
Bayon Hosting
Hidden
form form
form
<input
type=hidden
name=fieldname
value=field value
/>
40
Module 7: Forms
Bayon Hosting
</fieldset>
Tab Order
Tab order field focus user tab key
field field
tabindex=n attribute n
focus
Example:
<form method="post" action="register.php">
<fieldset>
<legend align="center"> User Info </legend>
User Name:<br />
<input type="text" name="txtName" tabindex="1" /><br />
Password:<br />
<input type="password" name="txtPassword" tabindex="2" />
</fieldset>
</form>
Keyboard Shortcut
alt + key field
attribute accesskey=character character a-z 09
Example:
<form method="post" action="register.php">
<fieldset>
<legend align="center"> User Info </legend>
User <u>N</u>ame:<br />
<input type="text" name="txtName" tabindex="1" accesskey="n" /><br />
Pass<u>w</u>ord:<br />
<input type="password" name="txtPassword" tabindex="2" accesskey="w" />
41
Module 7: Forms
Bayon Hosting
</fieldset>
</form>
Result:
42
Module 8: Multimedia
Bayon Hosting
Module 8: Multimedia
Sound
sound
web
Extension
.aiff
Description
.au
Miro-Law
Sun Microsystems computer
.mi
.ra, .ram
.wav
Microsoft Windows
src=sound url
controls=form
height=n
width=n
autostart=true|false
loop=n|true
align=left|center|right
/>
controls="form"
form
console, small console, playbutton, pausebutton, stopbutton, volumelever
loop="n|true" n
repeat true repeat
43
Module 8: Multimedia
Bayon Hosting
loop:
play file -1
Video
video
web
Description
Quick Time Movie
MPEG Movie
Audio-Video Interleaved
Extension
.mov, .qt
.mpeg, .mpg
.avi
src=video url
controls=form
height=n
width=n
autostart=true|false
loop=n|true
align=left|center|right
/>
controls="form"
form
console, small console, playbutton, pausebutton, stopbutton, volumelever
loop="n|true" n
repeat true repeat
Marquee
Marquee element child element
Syntax:
<marquee
behavior=alternate|slide|alternate
direction=left|right
loop=n|infinite|-1
scrollamound=n
scrolldelay=n
44
Module 8: Multimedia
Bayon Hosting
width=n
height=n
hspace=n
vspace=n
align=left|right
bgcolor=color
>
Scrolling Text
</marquee>
Attribute
behavior
Description
alternate:
scroll:
slide:
direction
loop
scrollamount
pixel
scrolldelay
miliseconds
width, height
hspace,
vspace
align
element
bgcolor
background
element wrap
45
Bayon Hosting
(hotwired.lycos.com/webmonkey/01/23/index1a.html) www.hotwired.com/webmonkey/99/31/index1a.html
site searchenginewatch.com Danny Sulivan
search engine optimization
About Keywords
visitors search engines keywords
keyword page
page search
engines page
keywords
keywords title
keywords headers
46
Bayon Hosting
keywors
47
Bayon Hosting
keyword
keywords
1. head page <meta name="keywords" content="
2. topic page
comma space
3. tag />
search engine
keywords meta tag
48
Bayon Hosting
goolge keywords
meta tag
keywords content page
content page
keyword spell
search visitor
49
Bayon Hosting
visitor
page
Google description
meta tag
visitors keyword context page
50
Bayon Hosting
Yahoo description
description meta tag
content page
page
51
Bayon Hosting
page
52
, comma space
Bayon Hosting
page page
53
Bayon Hosting
54
Bayon Hosting
3. page Folder
4. Export Bookmarks Favorites file
5. file texteditor remove bookmarks site file
site map
6. Upload file Server
7. Submit site map search engine
55
Bayon Hosting
56
Bayon Hosting
rank rank 20
www.google.com/webmasters/sitemaps/docs/en/sitemapgenerator.html
57
Bayon Hosting
yahoo http://docs.yahoo.com/info/suggest/
4. sitemap url page url text box submit
submit
The most popular general search engines are Google and Yahoo. Also see
http://www.useit.com/about/searchreferrals.html.
You might also want to register your site with a search engine that specializes in a
particular topic. For a list of such engines, see
http://searchenginewatch.com/links/article.php/2156351
58
Bayon Hosting
page
page
page link site link
site page page high rank
improve rank link
blog , substantive,
59
Bayon Hosting