Lecture Notes-HTML Part 1
Lecture Notes-HTML Part 1
Learning Objectives:
• Understand Tags, Elements and Attributes
• Understand the basic Structure of HTML
• Text Elements
• Lists
• Article Tag
• Tables
• Embedded Content: image, Audio, video, links etc.
• Forms
• Meta Tag
• Layout
• Additional Tags
3. Text Elements
1|Page
Purpose of HTML Text elements: display text in format that is appealing and readable.
Benefits of text elements:
• Display headings and paragraphs
• Markup bold, italic and underlining text
• Show different format of text like java code and normal readable text
List of Text Elements inside Body
1- Headings: Display the title of the Paragraph, show some text in bigger size and bolder
There 6 heading tags from <h1> …..<h6>
Example:
2- Horizontal Lines: acts like a separator between sections and paragraphs (add space
between paragraphs)
<hr> is a self-enclosing tag, you don’t need to close it
We can add attributes to it like width=”50%”, align=” left”
Example :
2|Page
3- Paragraphs: is place where you put most of the content to display on the browser
paragraphs tags helps to organize the content nicely into smaller container which makes
content easy to read and edit it
4- Single line break: Line breaks help to break the lines like new line (\n) start a new line
The more breaks you have the more lines are added
<br>: self-enclosing tag
5- Strong tag: helps to bold the text and highlight the text to emphasizes some line in the
paragraph it is the same like bold tag <b> <strong>
6- Emphasis: is used to emphasis a word or line in the paragraph similar to italic <em>
3|Page
7- Underline: simply underline the text, it is often used in the paragraphs
Example:
<u> Welcome to PSUT </u> → Welcome To PSUT
8- Italic Tag: will simply italic the text, it is often used in the paragraphs
10- Preformatted tag: is used to display the white space and it will retain the indication of
the format that is written in HTML file
<pre>
<code> Public void add (int a, int b)
{
Return a+b;
}
</code>
11- More HTML Text Tags </pre>
4|Page
<center> </center> Center Alignment <center> PSUT </center>
PSUT
This is PSUT
<small> </small> Make text smaller <small> PSUT </small>
PSUT
Style Arrtibute: is an attribute add on html tags to format text in way similar to CSS but
inside the tag will be discussed more later in CSS
Example:
<body style=” background-color: blue;”> Page Background
<h1 style=” color: red;”> Font Color
<p style=”font-family: Verdana;”> Font type
<h1 style=”text-align: center;”> Alignment
<h1 style=”text-decoration: underline; text-decoration-color: red;”> Underline color
<p style=”font-size:18px;”> Font size
4. Lists in HTML
Consist of three types:
❖ Definition List
❖ Ordered List
❖ Unordered List
5|Page
Definition List: Used to define definition of a list, it is often used as a header for the list
Ordered List: is used to show list of items with numbers, used to list points like 1,2,3 the
number will generated by the tag
6|Page
You can choose to start numbering from specific number like <ol Strat=”50”> here numbers will
begin from 50
<body>
Example 1 Example 2 : Nested Ordered List
<ol type=” A”>
<body>
<li> Engineering
<ol type=”1”>
<ol> <li> Electrical Engineering </li>
<li> Engineering </li>
<li> Power Engineering </li></ol></li>
<li> Computing Science </li>
<li> Computing Science </li>
<li> Business </li>
<ol> <li> Computer Science </li>
</ol>
<li> Animation</li>
</body>
<li>Software Engineering </li></ol></li>
<li> Business
<ol> <li> BIT </li>
<li> eMarketing</li>
<li> Business </li></ol></li>
</ol></body>
Unordered List: used to show list of items with circle dots, you can change the default list from
circle dot to any other symbol or image by using Style attribute in <ul> tag
7|Page