HTML
HTML
</body>
</html>
The <head> element contains meta information about the HTML page
The <title> element specifies a title for the HTML page (which is shown in
the browser’s title bar or in the page’s tab)
The <body> element defines the document’s body, and is a container for
all the visible contents, such as headings, paragraphs, images, hyperlinks,
tables, lists, etc.
An HTML element is defined by a start tag, some content, and an end tag:
The HTML element is everything from the start tag to the end tag:
HTML Headings
<h1> defines the most important heading. <h6> defines the least
important heading:
Example
HTML Paragraphs
Example
<p>This is a paragraph.</p>
HTML Links
Example
HTML Images
The source file (src), alternative text (alt), width, and height are provided
as attributes:
Example
HTML Attributes
The <a> tag defines a hyperlink. The href attribute specifies the URL of
the page the link goes to:
Example
The <img> tag is used to embed an image in an HTML page. The src
attribute specifies the path to the image to be displayed:
Example
<img src=”img_girl.jpg”>
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C#
BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS
NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO
KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
HTML Attributes
HTML Attributes
The <a> tag defines a hyperlink. The href attribute specifies the URL of
the page the link goes to:
Example
You will learn more about links in our HTML Links chapter.
Example
<img src=”img_girl.jpg”>
There are two ways to specify the URL in the src attribute:
The <img> tag should also contain the width and height attributes,
which specify the width and height of the image (in pixels):
Example
The required alt attribute for the <img> tag specifies an alternate text for
an image, if the image for some reason cannot be displayed. This can be
due to a slow connection, or an error in the src attribute, or if the user
uses a screen reader.
Example
The value of the title attribute will be displayed as a tooltip when you
mouse over the element:
Example
<p title=”I’m a tooltip”>This is a paragraph.</p>
Double quotes around attribute values are the most common in HTML, but
single quotes can also be used.
In some situations, when the attribute value itself contains double quotes,
it is necessary to use single quotes:
Or vice versa:
1. <html></html>
2. <h1></h1>
3. <p></p>
4. <b></b>
5.<i></i>
6.<ul></ul>
7. <ol> </ol>
8. <li></li>
9. <form></form>
10. <table></table>
13. src=”url”
14. <br>
15. <hr>
Explanation
PARAGRAPH TAG
ITALIC TAG
TABLE TAG
IMAGE TAG
Tag
Description
</center> <center>
<ul>... </ul>
<p>
<hr>
<img src=”...”>
Starts a paragraph
Defines a hyperlink
Set... in italics