HTML - Lists, Images and Hyperlinks
HTML - Lists, Images and Hyperlinks
HTML - Lists, Images and Hyperlinks
➢ HTML - Lists
HTML lists are used to present list of information in well
formed and semantic way. There are mainly two types of list in HTML and each
one has a specific purpose and meaning.
The list items in unordered lists are marked with bullets. Here's an example:-
The type Attribute
You can use type attribute for <ul> tag to specify the type of bullet you like.
By default, it is a disc. Following are the possible options −
<ul type = "square">
<ul type = "disc">
<ul type = "circle">
Example
<html>
<head>
<title>HTML Ordered List</title>
</head>
<body>
<ol>
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ol>
</body>
</html>
<head>
<title>HTML Definition List</title>
</head>
<body>
<dl>
<dt><b>HTML</b></dt>
<dd>This stands for Hyper Text Markup Language</dd>
<dt><b>HTTP</b></dt>
<dd>This stands for Hyper Text Transfer Protocol</dd>
</dl>
</body>
</html>
➢ HTML - Images
Images are very important to beautify as well as to depict
many complex concepts in simple way on your web page.
You can insert any image in your web page by using <IMG> tag. Following is the
simple syntax to use this tag.
<img src = "Image URL" ... attributes-list/>
The <IMG> tag is an empty tag, which means that, it can contain only list of
attributes and it has no closing tag.
1) src
It is a necessary attribute that describes the source or path of the image. It instructs
the browser where to look for the image on the server.
2) alt
The alt attribute defines an alternate text for the image, if it can't be displayed. The
value of the alt attribute describe the image in words. The alt attribute is considered
good for SEO prospective.
3) width
It is an optional attribute which is used to specify the width to display the image. It
is not recommended now. You should apply CSS in place of width attribute.
4) height
It h3 the height of the image. The HTML height attribute also supports iframe, image
and object elements. It is not recommended now. You should apply CSS in place of
height attribute.
Example :-
We can also link an image with other page or we can use an image as a link. To do
this, put <img> tag inside the <a> tag.
Example
<a href="https://www.technical.com/what-is-
robotics"><img src="robot.jpg" height="100" width="100"></a>
➢ HTML – Hyperlinks
A webpage can contain various links that take you directly to other
pages and even specific parts of a given page. These links are known as hyperlinks.
Hyperlinks allow visitors to navigate between Web sites by clicking on words,
phrases, and images. Thus, you can create hyperlinks using text or images available
on a webpage.
Linking Documents
A link is specified using HTML tag <a>. This tag is called anchor tag and anything
between the opening <a> tag and the closing </a> tag becomes part of the link and
a user can click that part to reach to the linked document. Following is the simple
syntax to use <a> tag.
<a href = "Document URL" ... attributes-list>Link Text</a>
Example :-
The href attribute specifies the target of the link. Its value can be an absolute or
relative URL.
An absolute URL is the URL that includes every part of the URL format, such as
protocol, host name, and path of the document,
e.g., https://www.google.com/, https://www.example.com/form.php, etc. While,
relative URLs are page-relative paths, e.g., contact.html, images/smiley.png, and so
on. A relative URL never includes the http:// or https:// prefix.
Example
*******