Download - HTML by Telerik Akademy
![Page 1: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/1.jpg)
HTMLThe past, the present, the future
Doncho Minkov
Telerik Academy Web Design Coursehtml5course.telerik.com
Technical Trainerhttp://minkov.it
![Page 2: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/2.jpg)
Table of Contents
1. Learn how to code HTML
2. Exercise
2
![Page 3: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/3.jpg)
Table of Contents (for real)
1. Introduction to HTML What is a Web Page?
My First HTML Page
Basic Tags: Hyperlinks, Images, Formatting
Headings and Paragraphs
2. HTML in Details The <!DOCTYPE> Declaration
The <head> Section: Title, Meta, Script, Style 3
![Page 4: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/4.jpg)
Table of Contents (2)
The <body> Section
Text Styling and Formatting Tags
Hyperlinks: <a>
Hyperlinks and Sections
Images: <img>
Lists: <ol>, <ul> and <dl>
HTML Special Characters
3. The <div> and <span> elements
4
![Page 5: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/5.jpg)
Table of Contents(3)
4. Introducing to HTML5 Changed old tags
New tags
New Attributes
New Structural Tags
5
![Page 6: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/6.jpg)
Introduction to HTMLWeb 101
![Page 7: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/7.jpg)
What is HTML HTML was designed to be simple language for describing documents It was created by scientists, so
“simple” is not always your average “simple”
Describing means outlining the structure of a document in terms of parts: headings, paragraphs, lists, tables etc.
To start coding HTML, just create a new file with “.html” extension, our touch it Think in structure, not presentation
7
![Page 8: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/8.jpg)
HTML Structure HTML was inspired by other similar languages, such as GML and Scribe
HTML1 had tags for the following elements: Paragraphs, Headings, Anchors
(links), Horizontal rule, Line breaks though they proved insufficient and later more were added
What are tags? A tag is the red letter from above
enclosed in angle brackets: <p> is for paragraph
A pair of starting and end tag forms an element
8
![Page 9: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/9.jpg)
Simple Q&A Q: Why Anchor and not Link? A: As mentioned earlier, HTML was created by scientists and they tend to have different opinion than we do Btw, there is Link in HTML, it just
does another job Q: So I just write opening and closed tags?
A: Mostly. There are exceptions. And you haven’t asked about
nesting
9
![Page 10: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/10.jpg)
Nesting Nesting is when you want to put a tag in a tag You’ve seen “Inception”, you know
what I mean
And like in “Inception”, the more you nest, the nastier it gets
Not all tags can be put in all tags Like, if you want to make an entire
paragraph to be a link, you don’t put the link around the paragraph, but vice versa
Scientists, go figure
10
![Page 11: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/11.jpg)
HTML Code Formatting The HTML source code should be
formatted to increase readability and facilitate debugging. Every block element should start on a
new line.
Every nested (block) element should be indented.
Browsers ignore multiple whitespaces in the page source, so formatting is harmless.
For performance reasons, formatting can be sacrificed 11
![Page 12: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/12.jpg)
What happened next? HTML evolved driven by people and browsers
New versions of HTML Inevitably a doctype
Accompanying technologies CSS, JavaScript
Plugins like Java, Flash, Silverlight Rich media and so on…
12
![Page 13: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/13.jpg)
My first web page first-page.html
<html><head>
<title>My first page!!!</title></head><body>
<p>I am making pages</p></body>
</html>
13
Boring
Boring
Content
![Page 14: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/14.jpg)
HTML BasicsTime to get dirty
![Page 15: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/15.jpg)
Some Simple Tags Hyperlink Tags
Image Tags
Text formatting tags
15
<a href="http://www.telerik.com/" title="Telerik">Link to Telerik Web site</a>
<img src="logo.gif" alt="logo" width="50" />
This text is <em>emphasized.</em><br />new line<br />This one is <strong>more emphasized.</strong>
![Page 16: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/16.jpg)
Simple Q&A Q: What are the equation looking things?
A: That would be attributes Attributes add more information to
an element Let’s examine:
So my src attribute equals (is) logo.gif
My alt attribute is logo
You can tell it’s 50 pixels wide
16
<img src="logo.gif" alt="logo" widht="50" />
![Page 17: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/17.jpg)
Attributes Some attributes can apply to all element: id, style, class, title The id is unique in the document The title attribute is displayed as
hint when the element is hovered with the mouse
Some attributes are optional Some are mandatory Some elements MUST have attributes the image element must have a src
attribute
17
![Page 18: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/18.jpg)
Remember It is important to have the correct vision and attitude towards HTML HTML is only about structure, not
appearance
Browsers tolerate invalid HTML code and parse errors – you should not
Always think about semantics
18
![Page 19: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/19.jpg)
Common tagsThe ones needed 80% of the time
![Page 20: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/20.jpg)
Hyperlinks Hyperlinks, or just links, are one-way tie between two documents
Put simply, if you have a page, and you want to go to another page, you click (follow) a link
A link must have a destination (href) attribute and text content Href means “hypertext reference”
Optionally, it my have a title
20
<a href="a.html" title=“Go to A">Click</a>
![Page 21: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/21.jpg)
Hyperlinks (2) Link to a document on the same server in the same directory:
Link to a document on the same server in the parent directory:
Link to a document on the same server in the sub directory stuff:
21
<a href="form.html">Fill Our Form</a>
<a href="../parent.html">Parent</a>
<a href="stuff/cat.html">Catalog</a>
![Page 22: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/22.jpg)
Hyperlinks (3) Link to a document on the same server in the root (top most) directory:
Remember: if not linking to the root (/), links
are relative to the current document and may be broken if you move the origin document
You can do any number of going up (../), but you can’t go upper than the root
22
<a href=“/form.html">Fill Our Form</a>
![Page 23: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/23.jpg)
Hyperlinks (4) Link to an external web site:
Always use the full URL, including the protocol (http://), not just “devbg.org”
Using the target attribute tells the browser where to open the link, with _blank meaning open in new window
Link to an email address:23
<a href="http://devbg.org" target="_blank">BASD</a>
<a href="mailto:[email protected]?subject=Bug+Report">Please report bugs here (by e-mail only)</a>
![Page 24: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/24.jpg)
Hyperlinks and Sections
Link to another location in the same document:
Link to a specific location in another document:
24
<a href="#section1">Go to Introduction</a>...<h2 id="section1">Introduction</h2>
<a href="chapter3.html#section3.1.1">Go to Section 3.1.1</a>
<!–- In chapter3.html -->...<div id="section3.1.1"> <h3>3.1.1. Technical Background</h3></div>
![Page 25: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/25.jpg)
Hyperlinks – Example
25
<a href="form.html">Fill Our Form</a> <br /><a href="../parent.html">Parent</a> <br /><a href="stuff/cat.html">Catalog</a> <br /><a href="http://www.devbg.org" target="_blank">BASD</a> <br /><a href="mailto:[email protected]?subject=Bug Report">Please report bugs here (by e-mail only)</a><br /><a href="apply-now.html"><img src="apply-now.png" /></a> <br /><a href="../english/index.html">Switch to English version</a> <br />
hyperlinks.html
![Page 26: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/26.jpg)
HyperlinksLive Demo
![Page 27: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/27.jpg)
Links to the Same Document – Example
27
<h1>Table of Contents</h1>
<p><a href="#section1">Introduction</a><br /><a href="#section2">Some background</A><br /><a href="#section2.1">Project History</a><br />...the rest of the table of contents...
<!-- The document text follows here -->
<h2 id="section1">Introduction</h2>... Section 1 follows here ...<h2 id="section2">Some background</h2>... Section 2 follows here ...<h3 id="section2.1">Project History</h3>... Section 2.1 follows here ...
hyperlinks-sections.html
![Page 28: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/28.jpg)
Links to the Same Document
Live Demo
![Page 29: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/29.jpg)
Inserting an image with <img> tag:
Image attributes:
Example:
Images: <img> tag
src Location of image file (relative or absolute)
alt Substitute text for display (e.g. in text mode)
height Number of pixels of the height
width Number of pixels of the width
border Size of border, 0 for no border
<img src="/img/basd-logo.png“ />
<img src="php.png" alt="PHP Logo" />29
![Page 30: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/30.jpg)
Headings and Paragraphs
Heading Tags (h1 – h6)
Paragraph Tags
Sections: div and span
30
<p>This is my first paragraph</p><p>This is my second paragraph</p>
<h1>Heading 1</h1><h2>Sub heading 2</h2><h3>Sub heading 3</h3>
<div>This is a div</div><span>This is a div</span>
![Page 31: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/31.jpg)
Headings and Paragraphs – Example
31
<html> <head><title>Headings and paragraphs</title></head> <body> <h1>Heading 1</h1> <h2>Sub heading 2</h2> <h3>Sub heading 3</h3>
<p>This is my first paragraph</p> <p>This is my second paragraph</p> </body></html>
headings-and-paragraphs.html
![Page 32: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/32.jpg)
Headings and Paragraphs
Live Demo
![Page 33: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/33.jpg)
Text Formatting Text formatting tags modify the
text between the opening tag and the closing tag Ex. <b>Hello</b> makes “Hello” bold<b></b> bold
<i></i> italicized
<u></u> underlined
<sup></sup> Samplesuperscript
<sub></sub> Samplesubscript
<strong></strong> strong
<em></em> emphasized
<pre></pre> Preformatted text
<blockquote></blockquote>
Quoted text block
<del></del> Deleted text – strike through33
![Page 34: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/34.jpg)
Simple Q&A Q: Bold or strong? A: Strong
Bold describes the looks e.g. the font is bold, strong describes the importance e.g. this word is emphasized on with great importance
Q: So I suppose it’s emphasized and not italics?
A: Correct Bold, italics, underline are
deprecated and will talk about that in a moment
34
![Page 35: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/35.jpg)
More on formatting Thinks semantics:
Emphasize, Strong emphasize, Insertion, Deletion, Sub-script, Super-script, Quotations
Those describe parts of the document
There are other, lesser known text formatting elements for input, output, variables and other parts of a document, say a tech spec, but if you come to need those, you can easily google
As usual, most of them are for scientific / engineering purposes and might look weird
35
![Page 36: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/36.jpg)
Text Formatting – Example
36
<html> <head> <title>Text formating</title> </head> <body> <h1>Notice</h1> <p>This is a <em>sample</em> Web page.</p> <p><pre>Next paragraph: preformatted.</pre></p> <h2>More Info</h2> <p>One line<br /> Next line.</p> </body></html>
text-
formatting.html
![Page 37: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/37.jpg)
Text Formatting
Live Demo
![Page 38: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/38.jpg)
a. Appleb. Orangec. Grapefruit
Ordered Lists Create an Ordered List using <ol></ol>:
Attribute values for type are 1, A, a, I, or i
38
1. Apple2. Orange3. Grapefruit
A. AppleB. OrangeC. Grapefruit
I. AppleII. OrangeIII. Grapefruit
i. Appleii. Orangeiii. Grapefruit
<ol type="1"> <li>Apple</li> <li>Orange</li> <li>Grapefruit</li></ol>
![Page 39: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/39.jpg)
Unordered Lists Create an Unordered List using <ul></ul>:
Attribute values for type are: disc, circle or square
39
• Apple
• Orange
• Pear
o Apple
o Orange
o Pear
Apple
Orange
Pear
<ul type="disk"> <li>Apple</li> <li>Orange</li> <li>Grapefruit</li></ul>
![Page 40: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/40.jpg)
Definition lists Create definition lists using <dl>
Pairs of text and associated definition; text is in <dt> tag, definition in <dd> tag
Renders without bullets
Definition is indented 40
<dl><dt>HTML</dt><dd>A markup language …</dd><dt>CSS</dt><dd>Language used to …</dd></dl>
![Page 41: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/41.jpg)
Lists – Example
41
<ol type="1"> <li>Apple</li> <li>Orange</li> <li>Grapefruit</li></ol>
<ul type="disc"> <li>Apple</li> <li>Orange</li> <li>Grapefruit</li></ul>
<dl> <dt>HTML</dt> <dd>A markup lang…</dd></dl>
lists.html
![Page 42: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/42.jpg)
ListsLive Demo
![Page 43: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/43.jpg)
Miscellaneous Tags <hr />: Draws a horizontal rule (line):
<center></center>: Deprecated!
<font></font>: Deprecated!
43
<hr size="5" width="70%" />
<center>Hello World!</center>
<font size="3" color="blue">Font3</font><font size="+4" color="blue">Font+4</font>
![Page 44: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/44.jpg)
Miscellaneous Tags – Example
44
<html> <head> <title>Miscellaneous Tags Example</title> </head> <body> <hr size="5" width="70%" /> <center>Hello World!</center> <font size="3" color="blue">Font3</font> <font size="+4" color="blue">Font+4</font> </body></html>
misc.html
![Page 45: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/45.jpg)
Miscellaneous Tags
Live Demo
![Page 46: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/46.jpg)
Introduction to HTMLHTML Document Structure in Depth
![Page 47: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/47.jpg)
HTML flavoursLime, mint and tonic
![Page 48: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/48.jpg)
HTML Versions HTML has evolved during the years
From a handful of tags to over a hundred
Though very few tags were removed, many new were added
By design, if a tag is not recognized, it’s ignored and its text content is shown
Problem: how to tell browsers which version is used in a document? 48
![Page 49: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/49.jpg)
The <!DOCTYPE> Declaration
HTML documents must start with a document type definition (DTD)
It tells web browsers what type is the served code
Possible versions: HTML 4.01, XHTML 1.0 (Transitional or Strict), XHTML 1.1, HTML 5
Example:
See http://w3.org/QA/2002/04/valid-dtd-list.html for a list of possible doctypes
49
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
![Page 50: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/50.jpg)
HTML vs. XHTML XHTML is more strict than HTML
Tags and attribute names must be in lowercase
All tags must be closed (<br/>, <img/>) while HTML allows <br> and <img> and implies missing closing tags (<p>par1 <p>par2)
XHTML allows only one root <html> element (HTML allows more than one)
50
![Page 51: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/51.jpg)
XHTML vs. HTML (2) Many element attributes are deprecated in XHTML, most are moved to CSS
Attribute minimization is forbidden, e.g.
Note: Web browsers load XHTML faster than HTML and valid code faster than invalid!
51
<input type="checkbox" checked>
<input type="checkbox" checked="checked" />
![Page 52: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/52.jpg)
Quick Q&A Q: Which doctype to use? A: XHTML 1.0 Transitional is usually OK Do not be tempted by XHTML 1.1
Q: How to remember them? A: Don’t. Just know which one does what and if needed google
52
![Page 53: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/53.jpg)
Boring stuffHead, body, comments and more…
![Page 54: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/54.jpg)
The <head> Section Contains information that doesn’t show directly on the viewable page
Starts after the <!doctype> declaration
Begins with <head> and ends with </head>
Contains mandatory single <title> tag
Can contain some other tags, e.g. <meta> <script> <style> <!–- comments -->
54
![Page 55: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/55.jpg)
<title> Title should be placed between <head> and </head> tags
Used to specify a title in the window titlebar
Search engines and people rely on titles
55
<title>Telerik Academy – Winter Season 2009/2010 </title>
![Page 56: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/56.jpg)
<meta> Meta tags additionally describe the content contained within the page
56
<meta name="description" content="HTML tutorial" />
<meta name="keywords" content="html, web design, styles" /> <meta name="author" content="Chris Brewer" />
<meta http-equiv="refresh" content="5; url=http://www.telerik.com" />
![Page 57: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/57.jpg)
<script> The <script> element is used to embed scripts into an HTML document Script are executed in the client's
Web browser
Scripts can live in the <head> and in the <body> sections
Supported client-side scripting languages: JavaScript (it is not Java!) – de facto
standard
VBScript (obsolete)
Jscript (obsolete)
57
![Page 58: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/58.jpg)
<style>
The <style> element embeds formatting information (CSS styles) into an HTML page
58
<html> <head> <style type="text/css"> p { font-size: 12pt; line-height: 12pt; } p:first-letter { font-size: 200%; } span { text-transform: uppercase; } </style> </head> <body> <p>Styles demo.<br /> <span>Test uppercase</span>. </p> </body></html>
style-example.html
![Page 59: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/59.jpg)
<!-- --> Comments can exist anywhere between the <html></html> tags
Comments start with <!-- and end with -->
59
<!–- Telerik Logo (a JPG file) --><img src="logo.jpg" alt=“Telerik Logo"><!–- Hyperlink to the web site --><a href="http://telerik.com/">Telerik</a><!–- Show the news table --><table class="newstable">...
![Page 60: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/60.jpg)
<body> Section: Introduction
The <body> section describes the viewable portion of the page
Starts after the <head> </head> section
Begins with <body> and ends with </body>
60
<html> <head><title>Test page</title></head> <body> <!-- This is the Web page body --> </body></html>
![Page 61: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/61.jpg)
HTML Special Characters
££British Pound
€€Euro
""Quotation Mark
¥¥Japanese Yen
——Em Dash
Non-breaking Space
&&Ampersand
>>Greater Than
<<Less Than
™™Trademark Sign
®®Registered Trademark Sign
©©Copyright Sign
SymbolHTML EntitySymbol Name
61
![Page 62: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/62.jpg)
Special Characters – Example
62
<p>[>> Welcome <<]</p> <p>►I have following cards: A♣, K♦ and 9♥.</p> <p>►I prefer hard rock ♫ music ♫</p> <p>© 2006 by Svetlin Nakov & his team</p> <p>Telerik Academy™</p>
special-
chars.html
![Page 63: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/63.jpg)
Special Chars – Example (2)
63
<p>[>> Welcome <<]</p> <p>►I have following cards: A♣, K♦ and 9♥.</p> <p>►I prefer hard rock ♫ music ♫</p> <p>© 2006 by Svetlin Nakov & his team</p> <p>Telerik Academy™</p>
special-
chars.html
![Page 64: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/64.jpg)
HTML Special Characters
Live Demo
![Page 65: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/65.jpg)
Using <DIV> and <SPAN> Block and Inline Elements
![Page 66: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/66.jpg)
Block and Inline Elements
Block elements add a line break before and after them, and expand to 100% width <div>, <p>, <h1>, <ul> are block
elements Inline elements don’t break the text before and after them <span>, <a>, <em> are inline
elements http://www.w3.org/TR/CSS2/visuren.html#block-boxes 66
![Page 67: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/67.jpg)
The <div> Tag <div> creates logical divisions within a page
Block style element Used with CSS Example:
67
<div style="font-size:24px; color:red">DIV example</div>
<p>This one is <span style="color:red; font-weight:bold">only a test</span>.</p>
div-and-
span.html
![Page 68: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/68.jpg)
<DIV>Live Demo
![Page 69: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/69.jpg)
The <span> Tag Inline style element Useful for modifying a specific portion of text Don't create a separate area
(paragraph) in the document Makes sense only with some CSS
69
<p>This one is <span style="color:red; font-weight:bold">only a test</span>.</p>
<p>This one is another <span style="font-size:32px; font-weight:bold">TEST</span>.</p>
span.html
![Page 70: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/70.jpg)
<SPAN>Live Demo
![Page 71: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/71.jpg)
HTML Tags Index http://www.w3.org/TR/html4/index/elements.html
http://www.htmldog.com/reference/htmltags/
71
![Page 72: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/72.jpg)
HTML 5What the … is HTML 5?
![Page 73: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/73.jpg)
What is HTML 5? HTML5 – the next major revision of the HTML Currently under development
Far away from final version
Developed under the HTML 5 working group of the World Wide Web Consortium (W3C) in 2007
First Public Working Draft of the specification January 22, 2008
Parts of HTML5 are being implemented in browsers before the whole specification is ready
73
![Page 74: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/74.jpg)
HTML – Past, Present, Future
1991 – HTML first mentioned – Tim Berners-Lee – HTML tags
1993 – HTML (first public version, published at IETF)
1993 – HTML 2 draft 1995 – HTML 2 – W3C 1995 – HTML 3 draft 1997 – HTML 3.2 – “Wilbur” 1997 – HTML 4 – ”Cougar” – CSS 1999 – HTML 4.01 (final) 2000 – XHTML draft 2001 – XHTML (final) 2008 – HTML5 / XHTML5 draft 2011 – feature complete HTML5 2022 – HTML5 – final specification
74
![Page 75: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/75.jpg)
HTML 5 Goals Latest version is HTML5
Aimed to have all of the power of native applications
Run on any platform (Windows, Linux, iPhone, Android, etc.)
New features should be based on HTML, CSS, DOM and JavaScript
Reduce the need for external plugins
Better error handling More markup to replace scripting 75
![Page 76: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/76.jpg)
Designer OutlookWhat a Designer Should Know?
![Page 77: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/77.jpg)
Changed Old Tags Doctype tag:
HTML tag:
Meta tag:
Link tag:
<!DOCTYPE html>
<html lang="en" xml:lang="en">
<meta charset="utf-8">
<link rel="stylesheet" href="style-original.css">
![Page 78: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/78.jpg)
New Layout Sctucture
Better layout structure: new structural elements <section> <header> <nav> <article> <aside> <footer>
<header>
<footer>
<nav> <aside>
<section><header>
<article>
<footer>
![Page 79: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/79.jpg)
New Layout Sctucture (2)
Elements like header and footer are not meant to be only at the top and bottom of the page
Header and footer of each document section Not very different from <DIV> tag
but are more semantically well defined in the document structure
![Page 80: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/80.jpg)
New Layout Sctucture – Example
<body>
<header> <hgroup> <h1>HTML 5 Presentation</h1> <h2>New Layout Structure</h2> </hgroup> </header>
<nav> <ul> Lecture </ul> <ul>
Demos </ul> <ul> Trainers </ul> </nav>
![Page 81: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/81.jpg)
New Layout Sctucture – Example (2)
<section> <article> <header> <h1>First Paragraph</h1> </header> <section> Some text </section> </article> </section>
<aside> <a href="http://academy.telerik.com"> more info</a> </aside>
<footer> Done by Doncho Minkov, (c) 2011, Telerik Academy </footer></body>
![Page 82: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/82.jpg)
New Layout Structure Tags
Live Demo
![Page 83: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/83.jpg)
New Tags <article>
For external content, like text from a news-article, blog, forum, or any other external source
<aside> For content aside from (but related to)
the content it is placed in <details>
For describing details about a document, or parts of a document
<summary> A caption, or summary, inside the
details element
![Page 84: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/84.jpg)
New Tags (2) <mark> For text that should be highlighted
<nav> For a section of navigation
<section> For a section in a document (e.g. chapters, headers, footers)
<wbr> Word break. For defining an appropriate place to break a long word or sentence
Other tags <command>, <datalist>, <details>, <progress>, etc.
![Page 85: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/85.jpg)
New Media Tags Media Tags
<audio> Attributes: autoplay, controls, loop, src
<video> Attributes: autoplay, controls, loop, height, width, src
<audio width="360" height="240" controls= "controls" > <source src="someSong.mp3" type="audio/mp3"> </source> Audio tag is not supported</audio>
![Page 86: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/86.jpg)
Playing AudioLive Demo
![Page 88: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/88.jpg)
Exercises
1. Write an HTML page like the following:
* Use headings and divs
88
![Page 89: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/89.jpg)
Exercises (2)2. Write an HTML page like the following:
3. Write an HTML page looking like the PNG file named 3.Introduction.PNG. Using the <a> tag add anchors to the corresponding sections in the same page.
89
![Page 90: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/90.jpg)
Exercises (3)4. Create an user
profile Web page Profile.html, friends page named Friends.html and info page named Info.html. Link them to one another using <a> tag
90
![Page 91: HTML by Telerik Akademy](https://reader033.vdocument.in/reader033/viewer/2022061104/5411c8eb8d7f729e728b4608/html5/thumbnails/91.jpg)
Exercises (4)
91
5. Create a Web site like the following:
See the image InetJava-site.png.