Professional Documents
Culture Documents
@CVRCE
Introduction
What Is Html?
✓ Browsers do not display the HTML tags, but use them to render the content of the page
@CVRCE
• Hypertext:
This provides a way to create a link between information of the same page as well as among different pages.
• Markup Language
Markup refers to the special tags that a part of the HTML document, which specify how the document content should be
displayed.
@CVRCE
HTML Versions
VERSION Year
HTML 1991
XHTML 2000
HTML5 2014
@CVRCE
HTML 1.0
✓ The first version of HTML that supported inline images and text controls .
• specify fonts
• use forms
• Because of these limitations, every web page created with HTML 1.0 looked the same with similar background and
the type of font used.
@CVRCE
HTML 2.0
• This specification supported more browsers. HTML 2.0 was considerably improved to support:
• It also supported:
• forms with limited set of form elements such as text boxes, and option buttons
• use of tables
HTML 3.2
• This version included support for creating tables and expanded options for form elements.
• This version also allowed web pages to include complex mathematical equations.
@CVRCE
HTML 4.01
• This version added support for style sheets and scripting ability for multimedia elements.
• It is focused on separating presentation styling information from the actual content by the use of style sheets.
• In HTML 4.0 with the use of style sheets, it is now possible to change the appearance/look of the website by changing
just the style sheet (s) itself.
• In comparison, in the earlier versions of HTML making the same changes for the entire website meant changing the
styling information in the individual pages!
@CVRCE
XHTML
• XHTML stands for EXtensible HyperText Markup Language.
• The XHTML 1.0 is the first document type in the XHTML family.
• If you already know HTML, then you need to give little attention to learn this latest version of HTML.
• XHTML was developed by World Wide Web Consortium (W3C) to help web developers make the transition from HTML to
XML.
@CVRCE
Page Structure
<Html>
<Head>
<Title>
</Title>
</Head>
<Body>
</Body>
@CVRCE
Write HTML Using Notepad
Step 1: Open Notepad (PC)
Windows 8 or later:
Open the Start Screen-> Type Notepad.
Step 2: Write Some HTML
Write HTML into Notepad.
@CVRCE
Step 3: Save the HTML Page
Select File > Save as in the Notepad menu.
@CVRCE
HTML Tags
Syntax:
➢ Tags are instructions that are embedded directly into the text of a HTML document.
➢ Each HTML tag describes that the browser should do something instead of simply displaying the text.
➢ In HTML, the tags begin with (<) and end with (>)
1. Paired Tags
2. Unpaired Tags
@CVRCE
@CVRCE
Paired Tags
A tag is said to be a paired tag if the text is placed between a tag and its companion tag.
In paired tags, the first tag is referred to as Opening Tag and the second tag is referred to as Closing Tag.
Example:
<P>Web Technologies</P>
Unpaired Tags
An unpaired tag does not have a companion tag. Unpaired tags are also known as Singular or Stand-Alone Tags.
Example
<br>
<hr>
@CVRCE
Exercises 1
Welcome to Gmail
Gmail
@CVRCE
HTML Headings
✓ Search engines use the headings to index the structure and content of your web pages.
Example:
@CVRCE
Style Attribute
✓ Use the style attribute for styling HTML elements
Syntax:
<tagname style="property:value;">
Property
✓ background-color for background color
✓ color for text colors
✓ font-family for text fonts
✓ font-size for text sizes
✓ text-align for text alignment
@CVRCE
HTML Background Color
The background-color property defines the background color for an HTML element.
Example:
@CVRCE
Html Text Color
@CVRCE
HTML Fonts
The font-family property defines the font to be used for an HTML element:
Example
@CVRCE
HTML Text Size
@CVRCE
HTML Text Alignment
@CVRCE
Text Formatting
Tag Description
@CVRCE
HTML Lists
• HTML offers web authors three ways for specifying of information on web page
✓ An unordered list.
✓ An ordered list.
✓ A Description List.
▪ This arranges your items in the same way as they are arranged in a dictionary.
@CVRCE
Unordered List
✓ An unordered list starts with the <ul> tag.
✓ The list items will be marked with bullets (small black circles) by default
@CVRCE
Unordered List - Choose List Item Marker
• The list-style-type property is used to define the style of the list item marker
Value Description
circle To a circle
square To a square
@CVRCE
Example
@CVRCE
Text Books:
@CVRCE
HTML Attributes
✓ Attributes provide additional information about HTML elements.
✓ Type of attributes
• src Attribute
@CVRCE
The href Attribute
HTML links are defined with the <a> tag. The link address is specified in the href attribute
Syntax:
Example
@CVRCE
Src Attribute and
✓ HTML images are defined with the <img> tag.
Syntax:
Example:
@CVRCE
The width and height Attributes
Syntax:
Example:
@CVRCE
The alt Attribute
The alt attribute specifies an alternative text to be used, when an image cannot be displayed.
Syntax:
<img src="img_girl.jpg" alt="Girl with a jacket" width="500" height="600">
@CVRCE
HTML Elements
HTML elements can be divided into two categories : block level and inline elements.
1. HTML block level elements can appear in the body of an HTML page.
@CVRCE
HTML inline elements
1. HTML inline level elements can appear in the body of an HTML page.
@CVRCE
Div Tag
✓ The HTML <div> tag is used to group the large section of HTML elements together.
✓ The div tag is generally used by web developers to group HTML elements together and apply CSS styles to many elements
at once.
✓ The <div> element has no required attributes, but style, class and id are common.
Example:
✓ If you wrap a set of paragraph elements into a div element so you can take the advantage of CSS styles and apply font style to
all paragraphs at once instead of coding the same style for each paragraph element.
@CVRCE
Syntax:
<div style=“property:value”>
<tag_name>some text</tag_name>
<tag_name>some text</tag_name>
</div>
Example:
<div style="border:1px solid pink;padding:20px;font-size:20px">
<p>Welcome to New_gen, Here you will learn live to life better way.</p>
</div>
@CVRCE
The <span> Element
• The <span> element is often used as a container for some text.
• The <span> element has no required attributes, but style, class and id are common.
• When used together with CSS, the <span> element can be used to style parts of the text
Example:
@CVRCE
Image Map Element
✓ image maps are still a valuable way to display complex sets of links
✓ The basic idea behind an image map is that you combine two different components:
▪ An image
✓ In HTML the image and the clickable areas are coded separately.
✓ it appears that portions of the image itself are linked to different destination.
@CVRCE
HTML Elements Used to Create Image Maps
There are three HTML elements used to create image maps:
img:
map:
area:
@CVRCE
Syntax for img
<map name=“map_name">
</map>
@CVRCE
What is HTML5?
• HTML5 is the newest version of HTML, only recently gaining partial support by the makers of web browsers.
• It incorporates all features from earlier versions of HTML, including the stricter XHTML.
• It adds a diverse set of new tools for the web developer to use.
@CVRCE
Html5 Page Structure
<header>
<nav>
<section>
<aside>
<article>
<Footer>
@CVRCE
What is New in HTML5?
<!DOCTYPE html>
<meta charset="UTF-8">
@CVRCE
<header> Element
The <header> element specifies a header for a document or section.
Example
<article>
<header>
<h1>What Does WWF Do?</h1>
<p>WWF's mission:</p>
</header>
<p>WWF's mission is to stop the degradation of our planet's natural environment,
and build a future in which humans live in harmony with nature.</p>
</article>
@CVRCE
<nav> Element
• The <nav> element defines a set of navigation links.
• Notice that NOT all links of a document should be inside a <nav> element.
• The <nav> element is intended only for major block of navigation links.
Example
<nav>
<a href="/html/">HTML</a>
<a href="/css/">CSS</a>
<a href="/js/">JavaScript</a>
<a href="/jquery/">jQuery</a>
</nav>
@CVRCE
<section> Element
✓ The <section> element defines a section in a document.
✓ A home page could normally be split into sections for introduction, content, and contact information.
Example:
<Section>
<dl> wwo</dl>
<dd> world web organization…………</dd>
</Section>
@CVRCE
<article> Element
✓ The <article> element specifies independent, self-contained content.
✓ An article should make sense on its own, and it should be possible to read it independently from the rest of the web site.
• Forum post
• Blog post
• Newspaper article
Example
<article>
<h1>What Does WWF Do?</h1>
<p>WWF's mission is to stop the degradation of our planet's natural environment,
and build a future in which humans live in harmony with nature.</p>
</article>
@CVRCE
Nesting <article> in <section> or Vice Versa?
• No, we cannot!
• So, on the Internet, you will find HTML pages with <section> elements containing <article> elements, and <article> elements
containing <sections> elements.
• You will also find pages with <section> elements containing <section> elements, and <article> elements containing <article>
elements.
The sport articles in the sport section, may have a technical section in each article.
@CVRCE
<aside> Element
The <aside> element defines some content aside from the content it is placed in (like a sidebar).
Example
@CVRCE
<footer> Element
The <footer> element specifies a footer for a document or section.
A footer typically contains the author of the document, copyright information, links to terms of use, contact information,
etc.
Example
<footer>
<p>Posted by: Hege Refsnes</p>
<p>Contact information: <a href="mailto:someone@example.com">
someone@example.com</a>.</p>
</footer>
@CVRCE
Removed Elements in HTML5
• The following HTML4 elements have been removed in HTML5:
@CVRCE
Migration from HTML4 to HTML5
HTML4 HTML5
@CVRCE
New HTML5 API's (Application Programming Interfaces)
The most interesting new API's in HTML5 are:
• HTML Geolocation
@CVRCE