What Is HTML
What Is HTML
HTML is an acronym which stands for Hyper Text Markup Language which is used for
creating web pages and web applications.HyperText is a way to link two or more web
pages (HTML documents) with each other.Markup language makes text
more interactive and dynamic. 'markup language' denotes a language that utilizes a
specific set of tags.
what is formatting???
HTML Formatting is a process of formatting text for better look and feel. HTML
provides us ability to format text without using CSS.2 types of formatting tags
are:
Physical tag: These tags are used to provide the visual appearance to the text.
Logical tag: These tags are used to add some logical or semantic value to the text.
<b>: is used to bold the text written between it.
<strong>:tells the browser that the text is important.
<i>:is used to make text italic.
<em>:is used to display content in italic.
<mark>:is used to highlight text.
<u>:is used to underline text written between it.
<tt>:is used to appear a text in teletype. (not supported in HTML5)
<strike>:is used to draw a strikethrough on a section of text. (Not supported in
HTML5)
<sup>:It displays the content slightly above the normal line.
<sub>:It displays the content slightly below the normal line.
<del>:is used to display the deleted content.
<ins>:displays the content which is added
<big>:is used to increase the font size by one conventional unit.
<small>:is used to decrease the font size by one unit from base font size.
TAGS:-
<br>: Line break.
<hr>: Horizontal rule.
<ul>: Unordered list.
<ol>: Ordered list.
<li>: List item.
<a>: Anchor (used for links).
<img>: Image.
<audio>: Audio content.
<video>: Video content.
Opening Tag: The opening tag starts with < and ends with >. For example, <p>.
Closing Tag: The closing tag also starts with < but includes a forward slash /
before the tag name, and ends with >.
2. Unpaired Tags (Self-Closing Tags or Stand-Alone Tags)
These are tags that don't require a closing tag. They are self-contained,
encapsulating all the information within a single tag.
Self-Closing Tag: A self-closing tag starts with < and ends with /> (though the /
is optional in HTML5). For example, <img /> or <br>.
The enclosing element is often referred to as the "parent," while the enclosed
element is called the "child."
Nested HTML Element = One HTML Element Inside Another HTML Element
For example:
An empty HTML element is one that does not have a closing tag or content. These
elements are also known as "void elements" or "self-closing elements."
HTML attributes are used to define the characteristics of an HTML element. They are
placed within the element's opening tag and consist of two parts: the name and the
value.
Core Attributes: These are basic attributes that can be applied to most HTML
elements. Examples include id, class, and style.
Internationalization Attributes: These attributes help adapt the document to
different languages and regions. Examples include lang and dir.
ID Attribute
The ID attribute is used to assign a unique identifier to an HTML element. Each
element with an ID has its own unique identity,
Class Attribute
The class attribute is used to associate an HTML element with a particular class,
typically for styling or JavaScript manipulation.
In CSS, elements with IDs are selected using a hash (#) symbol before the ID, and
elements with classes are selected using a dot (.) before the class name.
Title Attribute
The title attribute provides additional information about an element and is often
displayed as a tooltip when the mouse hovers over it.
HTML Comments
Comments are ignored by web browsers.
They aid in code readability and documentation.
HTML comments are denoted by <!-- content -->.
The shortcut key for commenting out code is Ctrl + /.
HTML supports both single-line and multi-line comments.
Skeleton Tags :-
1.HTML Tag
2.Head Tag
3.Body Tag
Image Tags:-
In HTML, the <img> tag is used to embed images into web pages. <img
src="images/profile_picture.jpg" alt="Profile Picture" />.The "src" and "alt"
attributes are essential for the proper functioning of the <img> tag.
src attribute: Specifies the path to the image file.
alt attribute: Provides a text description for the image.
Pre Tags:-
The <pre> tag is most effective when you want the text to display on your HTML page
exactly as it was typed, without any formatting changes. It is especially useful
for displaying code snippets or preformatted text from data files.