Htmlcourse 2 Beginners
Htmlcourse 2 Beginners
org/wiki/HTML/Training
Contents
1 Week 1
2 Week 2
3 Week 3
3.1 Tables
3.2 Forms
4 Week 4
4.1 Sections
4.2 Style and Script
Description
HTML stands for HyperText Markup Language. It is used to creating Web pages. That is,
Web page all over the world consists of HTML.
<!doctype html>
<html lang="en">
<head>
<title>Sample Web page</title>
</head>
<body>
<p>Here is a paragraph</p>
</body>
<cite></cite>
Some elements do not have an end tag (because they are implied by the following tags). For
example you might have seen.
<br/>
<input name='address'>
<input name="address">
__________
Create HTML
<html>
<head>
<title>this is the title of the page</title>
</head>
<body>
Hello!
</body>
</html>
Internet Explorer(Microsoft)
Firefox(Mozilla)
Chrome(Google)
Safari(Apple)
Opera(Opera)
try it
_______
2-HTML/Training/HTML Document
html element
The html element should always have a lang attribute. The lang attribute Specifies the primary
language for the contents of the element. For example, "en" means "English", "fr" means
"French".
The <html> ... </html> contains a head element followed by a body element.
<html lang="en">
</html>
head element
The <head> ... </head> contains the title, and information on style sheets and scripts.
Contents in the head tag are not displayed on a Web browser.
<head>
</head>
body element
The <body> ... </body> contains the markup with the visible content.
<body>
Here is the visible content
</body>
_______________
title
Web page's title is specified by <title>.
Title is used in a title bar of Web browsers, user's history, bookmarks, or in search results.
You should use titles that identify their documents even when they are used out of context.
try it
<html>
<head>
<title>this is the title of the webpage</title>
</head>
<body></body>
<html>
Basic content
Heading
Headings are specified by <h1>, <h2>, <h3>, <h4>, <h5> and <h6>.
<h1> is said to have the highest rank, <h6> has the lowest rank, and two elements with the
same name have equal rank.
<html>
<head></head>
<body>
<h1>h1 example</h1>
<h2>h2 example</h2>
<h3>h3 example</h3>
<h4>h4 example</h4>
<h5>h5 example</h5>
<h6>h6 example</h6>
</body>
</html>
Paragraph
Paragraphs are specified by <p>.
The hr element can omit end element. This is because It is empty element.
List
unordered list
<ul>
<li>List 1</li>
<li>List 2</li>
<li>List 3</li>
</ul>
ordered list
The items of the list are the li element child nodes of the ol element.
<ol>
<li>sample1</li>
<li>sample2</li>
<li>sample3</li>
</ol>
definition list
Definition list is specified by <dl>, <dt> and <dd>.
<dl>
<dt>tarm1</dt>
<dd>difinition1</dd>
<dt>tarm2</dt>
<dd>difinition2</dd>
</dl>
try it
[index.html]
<html >
<head>
<title>my shop</title>
</head>
<body>
<h1>my shop h1</h1>
<ul>
<li>menu</li>
<li>location</li>
<li>about us</li>
</ul>
<h2>new branch</h2>
<p>26 January 2011</p>
<p>
text text text text text text text text text text text text text text text
text text text text text
text text text text text text text text text text text text text text text
text text text text text
text text text text text text text text text text text text text text text
text text text text text
text text text text text text text text text text text text text text text
text text text text text
</p>
<h2>new menu</h2>
<p>26 January 2011</p>
<p>
text text text text text text text text text text text text text text text
text text text text text
text text text text text text text text text text text text text text text
text text text text text
text text text text text text text text text text text text text text text
text text text text text
text text text text text text text text text text text text text text text
text text text text text
</p>
<p>your shop</p>
</body>
</html>
Hyper Links
Hyper Links are specified by <a>.
Linked document is represented by the href attribute.
[syntax]
try it
<a>Go to Google</a>
2. Specifies the href attribute.
ex) [b.html-c.html]
[Syntax]
ex) [b.html-a.html]
Linking to be in a subdirectory:
[Syntax]
absolute URL
Challenge
1. Links to other pages in our Web site.
[index.html]
<ul>
<li><a href="menu.html">menu</a></li>
<li><a href="location.html">location</a></li>
<li><a href="about.html">about us</a></li>
</ul>
HTML/Training/Link options
Link options
_top: Open the most top-level browsing context of the current one.
<h2 id="top">Top</h2>
2. The a element with the href attribute. Value of the href attribute is a named hyperlink that you
would like to link.
[menu.html]
<h2 id="food">Food</h2>
<h2 id="drink">Drink</h2>
[menu.html]
HTML Images
<body>
<h1><img src="images/logo.png" alt="W3C" width="90" height="53"></h1>
</body>
Image
Images are specified by <img>.
The img element can omit end element. This is because It is empty element.
The image given by the src attribute is the embedded content.
SRC stands for source.
[syntax]
<img src="URL">
<img src="images/logo.png">
Alternative text
You can specify an alternative text for a image.
The value of the alt attribute give an alternative text for a image.
The intent is that replacing every image with the text of its alt attribute not change the
meaning of the page.
Image size
Images size are specified by the width attribute and the height attribute.
The width and height aren't strictly necessary but help to speed the display of your Web page.
[index.html]
HTML Videos
<video controls src="movie.mov">
<p>Your user agent does not support the HTML5 Video element.</p>
</video>
Embedded videos
The embedded videos are specified by <video>.
There are two way of specifying the embedded content.
<video src="movie.mov">
</video>
The <source> element allows authors to specify multiple alternative media resources for media
elements.
<video>
<source src="movie.mp4" type='video/mp4; codecs="avc1, mp4a"'>
<source src="movie.ogv" type='video/ogg; codecs="theora, vorbis"'>
</video>
Fallback contents
<video src="movie.ogv">
<p>Your user agent does not support the HTML5 Video element.</p>
</video>