unit 2
unit 2
Structure
LearningObjectives
Introduction
Mark up Tags
Heading-Paragraphs
Summary
KeyWords/Abbreviations
LearningActivity
References
LEARNINGOBJECTIVES
Explain Heading-Paragraphs
INTRODUCTION
.17
CU IDOL SELF LEARNING MATERIAL (SLM)
create web documents. A web document is viewed in a web browser, like the one you are
using to read this document. Just like in a word processor you can specify the appearance of
text, you can write HTML code to specify how the text or content of a web page should
look. For instance, in a word processor, you could choose to use Times Roman for font type
and make some text bold or italic. Similarly, in HTML code you could specify what type of
font to use or whether it should be bold or not. In the former, you could make the selection
using a mouse; however, for the letter, you would have to write instructions or HTML code.
MARK UP TAGS
A markup tag is a directive that contains snippet of code with a relative reference to an
object in your store such as a variable, URL, image, or block. Markup tags can be used
anywhere the editor is available and incorporated into the HTML
of email and newsletter templates, as well as other types of content. Markup tags are
enclosed in double, curly braces, and can either be generated by the Widget tool, or typed
is the fundamental characteristic of HTML.
Every markup tag is a left
bracket (<) and a right bracket (>). Markup tags are not revealed by a web browser; they are
invisible. In most cases, markup tags (containing commands) come in pairs, with text or a
graphic image located between the beginning and ending tags:
PARAMETER1="X" PARAMETER2="Y":
Note: Although quotation marks (" ") for supplementary parameters will be included in all
examples in this tutorial, these quotation marks are optional for most browsers and
usually do not need to be included in source code documents. One of the most common
errors in HTML scripting is leaving out one pair of quotation marks ("), causing the marked
up version to appear jumbled or nonsensical. This is one reason why elimination altogether
.18
CU IDOL SELF LEARNING MATERIAL (SLM)
of quotation marks around parameter variables may be the best option. So, a typical pair of
non-empty HTML tags in a source code, with the first tag containing a command along with
a few parameters, would resemble this:
of a single tag
rather than a pair of tags. That is, of a <COMMAND> tag and
lacks an ending </COMMAND> tag. Examples of non-empty and empty tags will be given
in other sections, recommend using UPPERCASE letters for all HTML commands and
associated parameters, because it is easier to distinguish them from regular text whenever
one creates or proofreads an HTML source code document. As told earlier, HTML is a
markup language and makes use of various tags to format the content. These tags are
enclosed within angle braces <Tag Name>. Except few tags, most of the tags have their
corresponding closing tags. For example, <html> has its closing tag </html> and <body> tag
has its closing tag </body> tag etc.
1 <!DOCTYPE...>
2 <html>
This tag encloses the complete HTML document and mainly comprises of
document header which is represented by <head>...</head> and document
body which is represented by <body>...</body> tags.
3 <head>
This tag represents the document's header which can keep other HTML tags
like <title>, <link> etc.
.19
CU IDOL SELF LEARNING MATERIAL (SLM)
4 <title>
The <title> tag is used inside the <head> tag to mention the document title.
5 <body>
This tag represents the document's body which keeps other HTML tags like
<h1>, <div>, <p> etc.
6 <h1>
7 <p>
To learn HTML, you will need to study various tags and understand how they behave, while
formatting a textual document. Learning HTML is simple as users have to learn the usage of
different tags in order to format the text or images to make a beautiful webpage.World Wide
Web Consortium (W3C) recommends to use lowercase tags starting from HTML 4.
<html>
<head>
Document header related tags
</head>
<body>
Document body related tags
</body>
</html>
The <!DOCTYPE> Declaration
The <!DOCTYPE> declaration tag is used by the web browser to understand the version of
the HTML used in the document. Current version of HTML is 5 and it makes use of the
<!DOCTYPE html>
.20
CU IDOL SELF LEARNING MATERIAL (SLM)
There are many other declaration types which can be used in HTML document depending on
what version of HTML is being used.
HEADING-PARAGRAPHS
HTML Headings-
Any document starts with a heading. You can use different sizes for yourheadings. HTML
also has six levels of headings, which use the elements <h1>,<h2>, <h3>, <h4>, <h5>, and
<h6>. While displaying any heading, browser addsone line before and one line after that
heading. The lower the number, the larger theheading size, as shown
Example
Type the HTML code in your Notepad window as shown in the figurebelow.
.21
CU IDOL SELF LEARNING MATERIAL (SLM)
Fig 2.2 output of code
Fig.2.3 Heading
Use the headings to set titles and subheadings. Mark with h1 the primary title on the page.
It's recommended to have only one h1 on the page that is similar to the <title> head tag to
show Google and other search engines what the page is about.
.22
CU IDOL SELF LEARNING MATERIAL (SLM)
<h1>An example heading</h1>
There are 6 different heading sizes, the one marked with 1 being the most important in
hierarchy.
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
To change the different heading sizes all you need to do is change h2 to whatever like h5.
Headings go from largest (h1) to smallest (h6). Also headings are good to use when you
want to make something big like a title of your web page. Another thing that you can do
with headings is something that we haven't done before. You can make the text centered or
to the right side of the screen.
Example-
<p>
This paragraph
contains a lot of lines
in the source code,
but the browser
ignores it.
</p>
<p>
This paragraph
contains a lot of spaces
in the source code,
but the browser
ignores it.
</p>
.23
CU IDOL SELF LEARNING MATERIAL (SLM)
Paragraphs-
There is also another tag that you can use to make line breaks. It is called the paragraph tag.
<p>Check</p>
<p>this</p>
<p>out! </p>
The p tag makes a bigger line break than the br tag. The paragraph tag is normally used
when you are writing paragraphs. At the beginning of the paragraph you would begin the p
tag and at the end you would end it. That way it would make a line break at the beginning
and end of your paragraph.
There is one more use for the p tags. You can use them to align things just like the heading
tags.
<pstyle="text-align: left;">Check</p>
<pstyle="text-align: center;">this</p>
<pstyle="text-align: right;">out!</p>
Example
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
HTML documents are divided into paragraphs. Paragraphs are defined with the tag. Each
paragraph of text should go in between an opening and a closing tag as shown below in the
example:
Type the HTML code in your Notepad window as shown in the figure bellow.
.24
CU IDOL SELF LEARNING MATERIAL (SLM)
Fig 2.4 Paragraph notepad
.25
CU IDOL SELF LEARNING MATERIAL (SLM)
When you are making a web page you just might want to make the browser go to a new line.
If you have tried that you might see that just pressing enter doesn't work. You have to insert
a tag to do that for you.
As you can see the br tag is one of the few tags that you don't need to close. Also if you need
to you can use more than one br tag at once to have a bigger space.
Example-
Use the tag, if you want a line break (a new line) without starting a new paragraph. The
element is an empty HTML element. It has no end tag. The tag has a space between the
characters br and the forward slash. If you omit this space, older browsers will have trouble
rendering the line break, while if you miss the forward slash character and just use it is not
valid in XHTML.Type the HTML code in your Notepad window
.26
CU IDOL SELF LEARNING MATERIAL (SLM)
Fig 2.7 output as per the following on the web browser
SUMMARY
HTML has six levels of headings, starting with '1' for the most significant and working
down to '6'. The associated text is highlighted by the Browser to stand out against the
normal body text. The syntax of the heading element is<Hn>Heading Text</Hn>
- is
contained between the beginning tag and the ending tag. A beginning tag and an
is placed before the command of the
ending tag to tell the browser that the command has been completed.
HTML defines six levels of headings. A heading element implies all the font changes,
paragraph breaks before and after, and any white space necessary to render the heading.
The heading elements are H1, H2, H3, H4, H5, and H6 with H1 being the highest (or
most important) level and H6 the least.
.27
CU IDOL SELF LEARNING MATERIAL (SLM)
recognizes this with attributes that assist with numbering headers and allow authors to
specify a custom graphic.
Paragraph elements are marked using the <p> tag. Whenever the browser encounters a
<p> tag, it starts the contents marked by it on a new line. Note that if you start a
sentence on a new line within the <p> tag, or if you indent sentences using spaces, the
browser will simply ignore all of this white-space.
When you use a paragraph tag, the browser will automatically show its contents on a
new line. What if you want to start something that is within your paragraph on a new
line? You can use the line break tag <br/> for that
KEY WORDS/ABBREVIATIONS
UL:A list of multi-line paragraphs, typically separated by some white space and/or
marked by bullets, etc.
Menu:A list of smaller paragraphs. Typically one line per item, with a style more
compact than UL.
Dir:A list of short elements, typically less than 20 characters. These may be arranged
in columns across the page, typically 24 character in width. If the rendering software
is able to optimize the column width as function of the widths of individual elements,
so much the better.
Tags & Elements: Tags are basic labels that define and separate parts of your
markup into elements. They are comprised of a keyword surrounded by angle
brackets <>. Content goes between two tags and the closing one is prefixed with a
slash (Note: there are some self-closing HTML tags, like image tags). Tags also have
attributes, which are
Usage- The basic tag that defines an html document.
LEARNINGACTIVITY
.28
CU IDOL SELF LEARNING MATERIAL (SLM)
UNIT END QUESTIONS (MCQ ANDDESCRIPTIVE)
(d)None of these
(a)-<TD>
(b)-<br>
(c)-<P>
(d)-<TR>
(a)<LL>
(b) <DD>
.29
CU IDOL SELF LEARNING MATERIAL (SLM)
(c) <DL>
(d)<DS>
(a)-<head>
(b)-<h6>
(c)-<heading>
(d)-<h1>
(a)Method
(b)Action
(c)Both (a)&(b)
(d)None of these
Answers
REFERENCES
Learning Web Design: A Beginner's Guide to HTML, CSS, JavaScript, and Web
Graphics Jennifer Robbins 2018
Web Design with HTML, CSS, JavaScript and jQuery SetJon Duckett2014
https://egyanagar.osou.ac.in/slm-hyper-text-markup-language-html.html
egyankosh.ac.in/bitstream/123456789/11763/1/Unit-2.pdf
.30
CU IDOL SELF LEARNING MATERIAL (SLM)
https://www.w3schools.com/html/html_intro.asp
https://html-css-js.com/html/tutorial/heading-paragraph-comment-list.php
Introduction to HTML (Hyper Text Markup Language) - A Review Paper May 2018
.31
CU IDOL SELF LEARNING MATERIAL (SLM)