0% found this document useful (0 votes)
32 views2 pages

HTML Codes Imp

Empty HTML elements like <br> don't need closing tags, but they can be closed for validation purposes. HTML links are defined with the <a> tag, images with the <img> tag. The title attribute adds a tooltip when moused over. Font size is defined with the font-size property for headings and paragraphs.

Uploaded by

api-344597985
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views2 pages

HTML Codes Imp

Empty HTML elements like <br> don't need closing tags, but they can be closed for validation purposes. HTML links are defined with the <a> tag, images with the <img> tag. The title attribute adds a tooltip when moused over. Font size is defined with the font-size property for headings and paragraphs.

Uploaded by

api-344597985
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Empty HTML Elements

HTML elements with no content are called empty elements.


<br> is an empty element without a closing tag (the <br> tag defines a line break).
Empty elements can be "closed" in the opening tag like this: <br />.
HTML5 does not require empty elements to be closed. But if you want stricter validation, or
if you need to make your document readable by XML parsers, you must close all HTML
elements properly.

HTML Links
HTML links are defined with the <a> tag:
<a href="[Link] is a link</a>
HTML Images

HTML images are defined with the <img> tag.


<img src="[Link]" alt="[Link]" width="104" height="142">
The title Attribute

Here, a title attribute is added to the <p> element. The value of the title attribute will be
displayed as a tooltip when you mouse over the paragraph:
<p title="I'm a tooltip">
This is a paragraph.
</p>
Code /
<html>
<body>
<h2>The title attribute</h2>
<p title="I'm a tooltip">
Mouse over this paragraph, to display the title attribute as a tooltip.
</p>
</body>
</html>

HTML Text Size

The font-size property defines the text size for an HTML element:
<h1 style="font-size:300%;">This is a heading</h1>
<p style="font-size:160%;">This is a paragraph.</p>

You might also like