HTML ppt (1)
HTML ppt (1)
▶ <html>
▶ <head>
▶ <title>Page title</title>
▶ </head>
▶ <body>
▶ <h1>This is a heading</h1>
▶ <p>This is a paragraph.</p>
▶ <p>This is another paragraph.</p>
▶ </body>
▶ </html>
HTML Versions List
•The <!DOCTYPE html> declaration defines that this document is an HTML5 document
•The <html> element is the root element of an HTML page
•The <head> element contains information about the HTML page
•The <title> element specifies a title for the HTML page (which is shown in the browser's
title bar or in the page's tab)
•The <body> element defines the document's body, and is a container for all the visible
contents,
such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
•The <h1> element defines a large heading
•The <p> element defines a paragraph
HTML Editors
View the HTML Page in Your Browser
Open the saved HTML file in your favorite browser (double click on the file, or
right-click - and choose "Open with").
The result will look much like this:
A Simple HTML Document
▶ <!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
What is an HTML Element?
▶ An HTML element is defined by a start tag, some content, and an end tag:
▶ <tagname> Content goes here... </tagname>
▶ The HTML element is everything from the start tag to the end tag:
▶ <h1>My First Heading</h1>
▶ <p>My first paragraph.</p>
▶ 1) Bold Text
▶ HTML<b> and <strong> formatting elements
▶ If you write anything between <strong>???????. </strong>, is shown important
text.
▶ See this example:
▶ <p><strong>This is an important content</strong>, and this is normal conten
t</p
2) Italic Text
▶ See this example:
▶ <p> <i>Write Your First Paragraph in italic text.</i></p>
3) HTML Marked formatting
▶ If you want to mark or highlight a text, you should write the content within
<mark>.........</mark>.
See this example:
▶ <h2> I want to put a <mark> Mark</mark> on your face</h2>
4) Underlined Text
▶ If you write anything within <u>.........</u> element, is shown in underlined
text.
See this example:
▶ <p> <u>Write Your First Paragraph in underlined text.</u></p>
HTML Text Formatting
5) Strike Text
▶ Anything written within <strike>.......................</strike> element is
displayed with strikethrough. It is a thin line which cross the statement.
See this example:
▶ <p> <strike>Write Your First Paragraph with strikethrough</strike>.</p>
Deleted Text
▶ Anything that puts within <del>..........</del> is displayed as deleted text.
See this example:
▶ <p>Hello <del>Delete your first paragraph.</del></p>
HTML Text Formatting
▶ Inserted Text
Anything that puts within <ins>..........</ins> is displayed as inserted text.
See this example:
<p> <del>Delete your first paragraph.</del><ins>Write another paragraph.</ins
></p>
HTML Attributes
href Attribute
Description Lists
HTML also supports description lists.
A description list is a list of terms, with a description of each term.
The <dl> tag defines the description list, the <dt> tag defines the term (name),
and the <dd> tag describes each term:
Unordered HTML List
Value Description
disc Sets the list item marker to a
bullet (default)
circle Sets the list item marker to a circle
square Sets the list item marker to a
square
none The list items will not be marked
Ordered HTML List
Type Description
type="1" The list items will be numbered
with numbers (default)
type="A" The list items will be numbered
with uppercase letters
type="a" The list items will be numbered
with lowercase letters
type="I" The list items will be numbered
with uppercase roman numbers
type="i" The list items will be numbered
with lowercase roman numbers
HTML Block and Inline Elements
▶ Every HTML element has a default display value, depending on what type of
element it is.
▶ There are two display values: block and inline.
Block-level Elements
A block-level element always starts on a new line, and the browsers automatically add some space
(a margin) before and after the element.
A block-level element always takes up the full width available (stretches out to the left and right as far as it can).
The <p> element defines a paragraph in an HTML document.
Inline Elements
An inline element does not start on a new line.
HTML Forms
▶ An HTML form is used to collect user input. The user input is most often sent to a server for processing.
▶
Type Description
<input type="text"> Displays a single-line text input
field
<input type="radio"> Displays a radio button (for
selecting one of many choices)
<input type="checkbox"> Displays a checkbox (for selecting
zero or more of many choices)
<input type="submit"> Displays a submit button (for
submitting the form)
<input type="button"> Displays a clickable button
Radio Buttons
Checkboxes
The <input type="checkbox"> defines a checkbox.
Checkboxes let a user select ZERO or MORE options of a limited number
of choices.
<form>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="Submit">
</form>
The Method Attribute
The method attribute specifies the HTTP (hypertext transfer protocol)method to be used when submitting the form data.
The form-data can be sent as URL variables (with method="get") or as HTTP post transaction (with method="post").
HTML Audio
To play an audio file in HTML, use the <audio> element
Playing a YouTube Video in
HTML
▶ To play your video on a web page, do the following: