TheBrahminCoder - What are HTML Tags And attributes
HTML tags are used to define the content of a web page and are enclosed in angle brackets. HTML attributes provide additional information about HTML elements. All HTML elements can have attributes. Attributes provide additional information about elements and are always specified in the start tag. Attributes usually come in name/value pairs like: name=“value”. Some of the commonly used HTML tags are:
<html>
: The root element of an HTML page.<head>
: The element that contains metadata about the document.<title>
: The element that specifies the title of the document.<body>
: The element that contains the visible content of the document.<h1>
,<h2>
,<h3>
,<h4>
,<h5>
,<h6>
: The elements that define headings.<p>
: The element that defines a paragraph.<a>
: The element that defines a hyperlink.<img>
: The element that defines an image.<ul>
,<ol>
,<li>
: The elements that define lists.
Some of the commonly used HTML attributes are:
href
: Specifies the URL of the page the link goes to.src
: Specifies the path to the image to be displayed.width
: Specifies the width of an image.height
: Specifies the height of an image.alt
: Specifies an alternate text for an image, if the image for some reason cannot be displayed.
EXAMPLE :
In this example, the
<html>
tag defines an HTML document. The <head>
element contains meta information about the document. The <title>
element specifies a title for the document. The <body>
element contains the visible page content. The <h1>
element defines a large heading. The <p>
element defines a paragraph.
Comments
Post a Comment