CH 2 (Lesson 1) - Basic of HTML
CH 2 (Lesson 1) - Basic of HTML
Chapter 2
Web Development Using HTML
5
Internet Programming I Chapter 2
Cont’d
Summary of the difference between HTML, CSS and JS
6
Internet Programming I Chapter 2
2. What HTML is and is not?
▪ HTML Stands for Hypertext Markup Language
7
Internet Programming I Chapter 2
Cont’d
▪ Hypertext
➢ Hyper is the opposite of linear
Goal
➢ Allow to access and read text and other
information from multiple perspectives.
8
Internet Programming I Chapter 2
Cont’d
▪ Markup Language
➢ Markup originally refers to the handwritten indicators on an author’s
manuscripts.
➢ The idea of markup Notify a typesetter the layout of a document and the
typeface to use
➢ A markup language is a set of characters or symbols that define a
document’s logical structure.
➢ In other words, it refers to the use of set of characters within a piece of
information that can be used to process or identify that information in a
particular way
➢ It composed of set of symbols called markup tags.
9
Internet Programming I Chapter 2
Cont’d
▪ HTML (Hypertext Markup Language)
➢ It is a markup language which based on Standard Generalized Markup
Language (SGML).
➢ SGML is a standard for specifying a markup language or tag set.
➢ SGML Itself is not a document language, but a description of how to
specify one and create a document type definition (DTD).
➢ It define the structure of information on the Web page.
➢ It doesn’t describe the actual presentation of a document
➢ It tells the web browser what content to display.
➢ Use a pre-defined set of tags to identify the webpage content types .
➢ It is not a programming language.
10
Internet Programming I Chapter 2
Cont’d Applications of HTML
▪ Web pages development
➢ HTML is used to create pages which are rendered over the web.
▪ Internet Navigation
➢ HTML provides tags which are used to navigate from one page to another and is
heavily used in internet navigation.
▪ Responsive UI
➢ HTML pages now-a-days works well on all platform, mobile, tabs, desktop/laptops.
▪ Offline support
➢ HTML pages once loaded can be made available offline on the machine without any
need of internet.
▪ Game development
• HTML5 has native support for rich experience and is now useful in gaming
development arena as well.
11
Internet Programming I Chapter 2
3. The evolution of HTML
▪ Before 1990 there was no easy way to find, download and view documents
over the internet.
▪ HTML, initially invented by in 1991 by Tim Berners Lee.
▪ Tim invented a system – the web (WWW)
➢ Store documents in one central place (i.e. a web
server)
➢ Make it possible to download and view a document
with a single click (i.e. a web browser)
➢ Allow to find new documents by clicking on “links”
inside other documents.
➢ Instead of licensing and selling his idea, he made
free for every one 12
Internet Programming I Chapter 2
Cont’d History of HTML
13
Internet Programming I Chapter 2
Cont’d HTML Standardization history
18
Internet Programming I Chapter 2
5. Anatomy of HTML Elements
➢ Syntax: <self-closing-tag-name/>
20
Internet Programming I Chapter 2
Cont’d
HTML Tags HTML attributes
➢ Used to markup the text (content) ➢ Defines a property for an elements
➢ Most of the tags come in as start ➢ It is a way to describe the tags
and end tag pairs ➢ It must enclosed within the start tag.
➢ However, empty element tags ➢ It comes in a name/value pairs
doesn’t come in pairs ➢ The value should enclosed within
➢ The start tag may contain an double quote
attribute. ➢ An element can have one or more
attributes
➢ Global attributes – an attributes that
are common to all HTML elements
21
Internet Programming I Chapter 2
Cont’d
HTML
Global
Attributes
22
Internet Programming I Chapter 2
Cont’d
HTML
Global
Attributes
23
Internet Programming I Chapter 2
Cont’d Simple rule
Note:
➢ Don’t forget the End tag.
➢ Even though HTML is case
insensitive use lowercase tags
24
Internet Programming I Chapter 2
Cont’d
Basic HTML document elements hierarchy - a showcase
25
Internet Programming I Chapter 2
Cont’d
HTML elements reference
▪ The HTML elements are grouped by function to help you find what you have
in mind easily.
▪ As per the HTML Living Standard 2021, the elements are grouped as follow
➢ Document metadata ➢ SVG and MathML
➢ Sectioning root ➢ Scripting
➢ Content sectioning ➢ Demarcating edits
➢ Text content ➢ Table content
➢ Inline text semantics ➢ Forms
➢ Image and multimedia ➢ Interactive elements
➢ Embedded content ➢ deprecated elements
Note: For the details of elements under each category just ctrl + click on the element category.
26
Internet Programming I Chapter 2
Cont’d
For detail and further refer check out
27
Internet Programming I Chapter 2
6. Content Model in HTML
▪ Content Model
➢ Refers to a description of the element's expected contents
➢ Set of rules that define what type of content each element is allowed to have.
➢ Also describe what other elements are allowed to be nested inside which
other elements.
▪ Prior to the modern HTML specification, HTML elements were either block-
level or inline elements.
▪ Modern HTML specification split these two content models into seven basic
models.
▪ However, in practical terms, you can still think of those seven models as
falling into the same traditional categories: block-level and inline elements.
28
Internet Programming I Chapter 2
Cont’d Block-level elements Vs. Inline elements
Block-level Elements
▪ By default, Block-level elements render (displayed) to begin on a new line (i.e. the
browser will automatically place the contents of that element on a new line in the
flow of the document.
Inline Elements
▪ Render on the same line by default.
▪ Having new line characters in the content or between the tags in your code won’t
make any difference.
▪ All white space characters get translated into a single space anyway and the whole
bunch of inline elements still be displayed on the same line.
▪ Inline elements are restricted to only contain other inline elements (i.e. doesn’t
contain block-level element)
29
Internet Programming I Chapter 2
Cont’d
Modern HTML Content Models
▪ Current HTML5 speciation categories and group elements that share common
characteristics.
▪ This is a loose grouping (it doesn't actually create a relationship among
elements of these categories), but they help define and describe the
categories' shared behavior and their associated rules.
▪ It's also possible for elements to not be a member of any of these categories.
32
Internet Programming I Chapter 2
Cont’d Summary of Content Models
No Content Model Description
➢ A broad category that encompasses most elements that can go inside
1 Flow content
the <body> element
➢ Defines the title of a section, whether marked by an explicit sectioning
2 Headlining content
content element, or implicitly defined by the heading content itself
➢ Create a section in the current outline that defines the scope of <header>
3 Section content
elements, <footer> elements, and heading content
➢ Modify the presentation or the behavior of the rest of the document, set up
4 Meta content
links to other documents etc.
5 Interactive content ➢ Includes elements that are specifically designed for user interaction
6 Phrasing content ➢ Defines the text and the markup it contains
➢ Imports another resource or inserts content from another mark-up
7 Embedded content
language or namespace into the document,
➢ Comprising elements that have a form owner, exposed by a form attribute,
8 Form-related content
and can be used everywhere flow content is expected
33
Internet Programming I Chapter 2
6. Browser Developer Tools
▪ Every modern web browser includes a powerful suite of developer tools.
▪ Also called web development tools or devtools or inspect element
▪ These tools do a range of things, from inspecting currently-loaded HTML, CSS
and JavaScript to showing which assets the page has requested and how long
they took to load
▪ With developer tools, we can directly interact with the source code that is
fetched into the client side of our system.
➢ Allow to understand the underlying structure of the code
➢ Enables us to inspect the web content
➢ Allow to test drive front-end changes,
➢ Check site's responsive design, and even optimize its performance
34
Internet Programming I Chapter 2
Cont’d
▪ These are the tools that are browser dependent.
➢ Come as browser add-ons or built-in features in web browsers.
➢ Most popular web browsers, such as Firefox, Google Chrome, Internet
Explorer, Safari, Microsoft Edge and Opera have built-in tools
➢ Moreover, many additional add-ons can be found in their respective plugin
download centers.
▪ Across all browsers, the basic functionality of the developer tools remains the
same, only naming conventions and terminologies changes.
▪ For details how to use the developer tools refers to the link below under the
Tools and setup section.
➢ https://developer.mozilla.org/en-US/docs/Learn/Common_questions
35
Internet Programming I Chapter 2
Cont’d How to find the developer tool?
Option 1:
▪ Open the browser Menu in the upper-
right-hand corner of the browser
window
▪ Select More Tools -> Developer Tools
Option 2:
▪ Right click on the page and select
“inspect”
Option 3:
▪ Key shortcut
36
Internet Programming I Chapter 2
Cont’d The developer tool Components
▪ Elements
▪ Resources
▪ Scripts
▪ Timeline
▪ Profiles
▪ Storage
▪ Audit
▪ Console
37
Internet Programming I Chapter 2
Tips
HTML standards documents
1. HTML Living Standard
➢ https://html.spec.whatwg.org/multipage/#toc-semantics
2. A vocabulary and associated APIs for HTML and XHTML (W3C Working Draft, 2011)
➢ http://www.w3.org/TR/2011/WD-html5-20110525/
3. MDN Web Docs - Resources for developers, by developers
➢ https://developer.mozilla.org/en-US/
Validation service
➢ https://validator.w3.org/
38
Internet Programming I Chapter 2
Tips
Learning resources
1. W3Schools
➢ https://www.w3schools.com/html/default.asp
2. Code Academy
➢ https://www.codecademy.com/
3. FreeCodeCamp
➢ https://www.freecodecamp.org/
4. Tutorials to Night
➢ https://www.tutorialstonight.com/
5. MOOCs
➢ HTML CSS JavaScript course for Web Developers by Coursera
➢ Basics of Web Development by Coursera
➢ Zero to Mastery course by Udemy
39
Internet Programming I Chapter 2
Summary
➢ HTML, CSS and JavaScript are the core web development technologies
➢ HTML is a markup language that used to define the structure of web
document
➢ HTML uses tags (characters that sit inside angled brackets) to give the
information they surround special meaning.
➢ HTML document mainly consist the “head” and “body” section.
➢ HTML elements are comprise tags and character data (content)
➢ Tags usually come in pairs. The opening tag denotes the start of a piece of
content; the closing tag denotes the end.
➢ HTML attributes describe the content of the element and require a name
and a value.
Chapter 2 40
Internet Programming I
Summary
➢ HTML initially invented by in 1991 by Tim Berners Lee and standardized since 1997.
➢ HTML5 is the current web development standard
➢ Content model refers to set of rules that define what type of content each element
is allowed to have.
➢ Prior to HTML5 the elements were either block-level or inline elements.
➢ Modern HTML specification (HTML5) split these two content models into seven
basic models and each elements in HTML5 falls into zero or more categories that
group elements with similar characteristics
➢ Browser developer tool are browser dependent inspection tools that come as
browser add-ons or built-in features in web browsers.
➢ Developer tools allow to understand the underlying structure of the code and also
to inspect the web content
Chapter 2 41
Internet Programming I
Chapter Activity
1. Differentiate Hypertext, hyperlink and hypermedia.
2. What are other types of Markup Languages? List and discuss their
differences.
3. What are the main elements that define the HTML document?
4. Why W3C and WHATWAG are not able continue to collaborate?
5. Why content models are important? Briefly discuss the common seven main
content model categories.
6. Discuss the use of developer tool components.
Chapter 2 42
Internet Programming I
Thank You
For Your Attention!!
43
Internet Programming I Chapter 2