Improve Your HTML5 Formatting And HTML5 Image tag
HTML5 Tags for line break,spacing,comments
1.Tags For line break:
For line break in HTML, the <br> tag is used.
It is used for writing addresses or poems. It is used for adding breaks in line not for adding spaces in the paragraph. This tag supports Global Attributes and Event Attributes in HTML.
<!DOCTYPE HTML>
<HTML>
<body>
<h1>The br element</h1>
<p><br>Learning Web development <br> is easy <br> with techfreaktalks </p>
</HTML>
</body>
OUTPUT:
2.For additional spacing (HTML for space) :
Additional spaces in HTML cannot be added by clicking the space-bar multiple times.HTML spacing code is“ ”.nbsp stands for non-breaking space.
For example:
test1 test2
Then you have to write it like test1       test2
3.Comment in HTML:
The HTML comments section is used to keep notes in your code section but it does not get displayed on the web page.If your code is too big or too complicated then for making it easy to understand commonly comments are used. Comment tag does not support the Standard attribute and Event attribute.
For this we use
PROGRAM:
<!DOCTYPE HTML>
<HTML>
<body>
<!-- This is a comment -->
<p>HTML COMMENT.</p>
<!-- whatever you want to add as a private note -->
</body>
</html>
OUTPUT:
Learn HOW TO MAKE HTML LIST
HTML Tags for LISTS
HTML tags for lists:
- Unordered list
- Ordered List
This is embedded inside either the OL or the UL element.
The unordered list can be nested. List items can contain other HTML components.
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JAVASCRIPT</li>
</ul>
Each item in the ordered list starts with <li> tag and ends with </li>But the default ordered list takes numerical values. An ordered list can be nested.
<ol>
<li>HTML</li>
<li>CSS</li>
<li>JAVASCRIPT</li>
</ol>
<!DOCTYPE HTML>
<HTML>
<body>
<h2>An Unordered HTML List</h2>
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JAVASCRIPT</li>
</ul>
<h2>An Ordered HTML List</h2>
<ol>
<li>HTML</li>
<li>CSS</li>
<li>JAVASCRIPT</li>
</ol>
</body>
</html>
OUTPUT:
OTHER LIST in HTML:
In the HTML description list is also used.
<dl> is used for description lists.
<dt> is used for description terms(name).
<dd> is used for describing each term.
HTML Image tag:
How to insert an HTML image?
Html images are used to give an aesthetic look and design to your web pages.<img> HTML tag is used to add the desired image to a web page.
Two attributes are used along with the <img>tag in HTML.
- Src: gives the path of the image.HTML image URL is added in the source.
- Alt: gives the alternate text to be displayed if the image is not loaded due to technical issues.
The src attribute:
Src attribute detects an image by its URL. The image from the URL is retrieved with the help of a browser and then embedded into the document when the web page loads.
The Alt attribute:
The alt attribute is useful when an image is not displayed on the webpage. By seeing the alternate text added, the user comes to know about some idea of the image.
SYNTAX:
<img src= “img url” alt=”alternatetext">
You can define the HTML image size by width and height of the image by adding width and height attributes in the <img>tag.
<img src= “img url” alt=”alternatetext'' width ="200" height="300">
PROGRAM :
<!DOCTYPE HTML>
<HTML>
<body>
<h1>The img element</h1>
<img src="img_girl.jpg" alt="Girl " width="500" height="600">
</body>
</html>
HTML Image map tag :
Image mapping is used to create clickable areas on the image.
What is the use of the anchor tag?
- For adding hyperlinks to your image we use an anchor tag.
- If you click on any section of the image it will direct you to that connected hyperlink.
So, we have another way to create hot-spot areas or more than one hyperlink on our image.
To create more than one hyperlinks we need to create a map. To create a map we use <map> tag.
<map> tag is a pair tag so we need to create a closing tag of map i.e. </map> tag.Inside a map tag, we create hotspot areas. So for that, we need to create a <area> tag. This is an unpaired tag.
<area> tag takes few attributes.
Shape attribute:
- Rect: It is going to create a rectangle area
- Circle: It is going to create a circular area
- poly: It is going to create a polygonal area
- default: It is going to take the entire area
coords attribute:
coords is an attribute that takes coordinates. Here we have to give values to coords attribute.
Values that we give to coords are “‘left’, ‘top’, ‘right’, ‘bottom’”.
Syntax:
Now, the next important step is to give a name to the map. And this name which is given to the map tag is going to be used by <img> tag. We use an attribute called a usemap. In between, we give ‘# name of that image.
For different sections in the image, we will use different <area> tags and we will repeat this process.
Html image map creator is basically used for creating multiple clickable areas in the image.
👌👌 Nice
ReplyDeleteThanks
DeleteExplained very well
ReplyDeleteThank you
DeleteVery helpful
ReplyDeleteThanks
DeleteNice information
ReplyDeleteVery clear 👍
ReplyDeleteThank you
DeleteKeep it up ma'am.
ReplyDeleteGreat work
How to insert video and what are the relevant tags regarding that
ReplyDeletePlease tell
Ya sure we will explain that point in next blog.
Delete