Explore HTML-History, Working, Elements & Tags with Examples
Explore HTML-History, Working, Elements & Tags with Examples
Introduction to HTML
Html
HTML stands for Hypertext Markup Language. It is the standard language used to create web pages. It is a markup language that uses tags to describe the structure and content of a webpage. HTML serves as the backbone of the World Wide Web, providing the structure for web pages. It works by utilizing markup tags to define the various elements within a document, such as headings, paragraphs, links, images, and more. These tags communicate to web browsers how content should be displayed and arranged on a page, ensuring consistency and clarity across different platforms and devices. is the standard language used to create web pages. It is a markup language that uses tags to describe the structure and content of a webpage. In this tutorial, we will cover the basics of HTML and how to create a simple webpage using this language.
Concept of HTML
How HTML Works:
HTML, or Hypertext Markup Language, serves as the foundation of web development, providing a structured way to create web pages. Here's a breakdown of how HTML works: 1. Text-Based Markup: HTML documents are plain text files containing markup tags that define the structure and content of a web page. These tags are interpreted by web browsers to render the page correctly. 2. Document Structure: An HTML document typically begins with a `<!DOCTYPE html>` declaration, which specifies the document type and version of HTML being used. The `<html>` tag encloses the entire document, while the `<head>` and `<body>` tags define the head and body sections, respectively. 3. Tags and Elements: HTML uses a system of tags to create elements such as headings, paragraphs, links, images, and more. Tags consist of angle brackets (`< >`) enclosing the name of the element, such as `<p>` for paragraphs or `<img>` for images. 4. Attributes: Elements can have attributes that provide additional information or modify their behavior. Attributes are specified within the opening tag and include properties like `src` for images or `href` for links. 5. Hierarchy and Nesting: HTML elements can be nested within one another to create a hierarchical structure. For example, a `<ul>` (unordered list) element can contain multiple `<li>` (list item) elements. 6. Rendering in Web Browsers: Web browsers parse HTML documents and render them into visually appealing web pages. They interpret the markup tags, apply styles (defined by CSS), and execute scripts (written in JavaScript) to create interactive experiences. 7. Compatibility and Standards: HTML follows a set of standards defined by the World Wide Web Consortium (W3C) to ensure consistency and compatibility across different browsers and devices. While modern browsers generally adhere to these standards, developers may need to consider compatibility issues when writing HTML code. 8. Accessibility and SEO: Well-structured HTML code enhances accessibility for users with disabilities and improves search engine optimization (SEO) by making it easier for search engines to crawl and index web pages. In summary, HTML works by providing a standardized way to structure and format content on the web, enabling developers to create engaging and accessible websites that can be interpreted and rendered by web browsers.History of HTML
Structure of HTML Page
HTML is mainly divided into three sections
Elements of HTML
HTML ATTRIBUTES
Create First HTML Page
Title Tag
The title tag in HTML is used to define the title of a web page. It is positioned within the head section of an HTML document. The text specified within the title tag is displayed in the browser's title bar or tab when the web page is viewed. Here's an example of a title tag:
<TITLE>My First Webpage</TITLE>
Body Tag
The <body> tag in HTML is used to define the main content of a web page. It encapsulates all the visible content that users see when they visit a website. This tag typically contains text, images, links, multimedia elements, and other HTML elements that make up the webpage's content. The <body> tag also allows you to specify various attributes to control the appearance and behavior of the content within it, such as background color, text color, and event handlers for when the page loads or unloads.Attributes of Body section
Here are some common attributes that can be used with the <body> tag along with their descriptions:
bgcolor: This attribute sets the background color of the body element. It takes a color value in various formats such as hexadecimal, RGB, or color names.
Example: <body bgcolor="#ffffff">
text: This attribute sets the default text color for the content within the body element. It accepts color values similar to the bgcolor attribute.
Example: <body text="#000000">
link: This attribute sets the default color of unvisited hyperlinks within the body element.
Example: <body link="#0000FF">
alink: This attribute sets the color of hyperlinks while they are being clicked or activated.
Example: <body alink="#FF0000">
vlink: This attribute sets the color of hyperlinks that have already been visited.
Example: <body vlink="#800080">
background: This attribute specifies the URL of an image to be used as the background for the body element.
Example: <body background="background.jpg">
Attribute
Description
Syntax
Default
Value
Background
It
contains the URL of the background image. It is used to set the background
image.
<BODY
BACKGROUND=“hi.gif”>
No image
Bgcolor
It is
used to specify the background color of an image.
<BODY
BGCOLOR=“Black”>
White
colour
Text
It
specifies the color of the text in a document.
<BODY
TEXT=“Blue”>
Black
colour
Link
Alink
Vlink
It is
used to specify the color of visited links.
It is
used to specify the color of the active link.
It
specifies the color of visited links.
<BODY
LINK=“#0000FF”
VLINK=“#FF00FF”
ALINK=“FFFF00”>
Blue
Purple
Yellow
Attribute |
Description |
Syntax |
Default
Value |
Background |
It
contains the URL of the background image. It is used to set the background
image. |
<BODY
BACKGROUND=“hi.gif”> |
No image |
Bgcolor |
It is
used to specify the background color of an image. |
<BODY
BGCOLOR=“Black”> |
White
colour |
Text |
It
specifies the color of the text in a document. |
<BODY
TEXT=“Blue”> |
Black
colour |
Link Alink Vlink |
It is
used to specify the color of visited links. It is
used to specify the color of the active link. It
specifies the color of visited links. |
<BODY LINK=“#0000FF” VLINK=“#FF00FF”
ALINK=“FFFF00”> |
Blue Purple Yellow |
Heading Tag
Heading Tag |
In this example, <h1>Main Heading</h1> is the highest level heading, <h2>Subheading</h2> is a subheading, and <h3>Sub-subheading</h3> is a subheading of the subheading and so on. These heading tags help to structure the content and provide visual cues to users about the hierarchy of information on the page.
Paragraph tag
Break Tag
hr tag
Attributes of <HR>
Attribute |
Description |
Default
Value |
SIZE |
Height of the rule in pixels |
2 pixels |
WIDTH |
Width of the rule in pixels or percentage of screen
width |
100% |
NOSHADE |
Draw the rule with a flat look instead of a 3D look |
Not set (3D look) |
ALIGN |
Aligns the line (Left, Center, Right) |
Center |
COLOR |
Sets a color for the rule (IE 3.0 or later) |
Not set |
Character Formatting in HTML
<b>This text is bold</b>
2. Italic: Use the `<i>` tag to make text italic.
<i>This text is italic</i>
3. Underline: Use the `<u>` tag to underline text.
<u>This text is underlined</u>
4. Strikethrough: Use the `<s>` or `<strike>` tag to strikethrough text.
<s>This text has a strikethrough</s>
<strike>This text also has a strikethrough</strike>
5. Superscript: Use the `<sup>` tag to create superscript text.
6. Subscript: Use the `<sub>` tag to create subscript text.
H<sub>2</sub>O
7. Font Size: Use the `style` attribute to change the font size.
<font size = "7">Font size = "7"</font>
<p>
<font color = "#FF00FF">This text is in pink</font> <font color = "red">This text is red</font> </p>
<p>
<font face = "Comic sans MS" size =" 5">Comic Sans MS</font> </p>
Summery
Attribute |
Description |
Default
Value |
Syntax |
FONT FACE |
DESCRIBE
THE FONT FACE(NAME) |
DEFAULT
FONT |
<font face = "Times New Roman“>Font
</FONT> |
FONT SIZE |
DESCRIBE
THE FONT SIZE |
3 |
<FONT
SIZE=“20”> TWENTY sizes </FONT> |
BOLD, ITALIC, UNDERLINE |
TO CHANGE
THE FONT FACE |
NORMAL |
<B>
Bold </B> <I> Italic </I> <U>
Underline </U> |
FONT COLOR |
TO CHANGE
THE FONT COLOR |
BLACK |
<FONT
COLOR=“#RRGGBB”> Color</FONT> |
PREFORMATED |
PREFORMATED
TEXT |
NOT
PREFORMATED |
<PRE>
Preformatted </PRE> |
<EM> Emphasis
</EM> <STRONG>
STRONG </STRONG> <TT> TELETYPE </TT> <CITE> Citation </CITE> |
DIFFERENT
FONT FACES |
NORMAL |
<EM> Emphasis
</EM> <STRONG>
STRONG </STRONG> <TT>
TELETYPE </TT> <CITE>
Citation </CITE> |
Example of Character Formatting
Character formatting in HTML |
Colors in HTML
color coding in HTML |
Alignments in HTML
Left Align:
Center Align:
Right Align:
Alignment in HTML |
List in HTML
Unordered List (`<ul>`):
Ordered List (`<ol>`):
List Item (`<li>`):
Definition List (<dl>)
Definition List (<dl>):
Definition Term (<dt>):
Definition Description (<dd>):
Nested Lists:
Table in HTML
Conclusion
FAQ(Frequently Asked Question)
What is HTML ?
HTML stands for Hypertext Markup Language. It is the standard language used to create web pages.
Decsribe the structure of HTML ?
HTML is mainly divided into three sections Head:- Include title of document, heading and other information related for heading of document Body:-Include all the content of page like paragraph, picture, video, text, audio etc Footer:-Include the content like date time and other content related for footer of the document.
What are elements in HTML ?
HTML consists of a variety of elements that define the structure and content of a web page. These elements range from basic text formatting to multimedia integration.
What are HTML attributes ?
Attributes provide additional information about HTML elements and modify their behavior or appearance.
Post a Comment