All HTML elements can have attributes. Attributes provide additional information about elements. Attributes are always specified in the start tag. Attributes usually come in name/value pairs like: name=”value”.
<a> tag defines a hyperlink. The href attribute specifies the URL of the page the link goes to.
<a href="https://www.monsterenergy.com">Visit Monster Energy</a><img> tag is used to embed an image in an HTML page. The src attribute specifies the path to the image to be displayed.
<img src="crazy.jpg"><img> tag should also contain the width and height attributes, which specify the width and height of the image (in pixels).
<img src="crazy.jpg" width="500" height="600"><img src="img_girl.jpg" alt="Girl with a jacket"><html lang="en"><p title="I'm a tooltip">This is a paragraph.</p>| Tag | Description |
|---|---|
<!--...--> |
Defines a comment |
<head> |
Contains metadata/information for the document |
<header> |
Defines a header for a document or section |
<footer> |
Defines a footer for a document or section |
<body> |
Defines the document’s body |
Tag | Description
——————–|——————–
<!DOCTYPE> | Defines the document type
<title> | Defines a title for the document
<link> | Defines the relationship between a document and an external resource (most used to link to style sheets)
<style> | Defines style information for a document
<meta> | Defines metadata about an HTML document
Tag | Description
—————————-|—————————-
<a> | Defines a hyperlink
<img> | Defines an image
<blockquote> | Defines a section that is quoted from another source
<code> | Defines a piece of computer code
<ol> | Defines an ordered list
<ul> | Defines an unordered list
<li> | Defines a list item
<h1> to <h6> | Defines HTML headings
<div> | Defines a section in a document
<span> | Defines a section in a document
<p> | Defines a paragraph
<br> | Defines a single line break
<em> | Defines emphasized text
<b> | Defines bold text
<strong> | Defines important text
<i> | Defines a part of text in an alternate voice or mood
<sub> | Defines subscripted text
<s> | Defines text that is no longer correct
<center> | Defines centered text (Not supported in HTML5. Use CSS instead.)
Tag | Description
——————–|——————–
<form> |Defines an HTML form for user input
<input> |Defines an input control
<textarea> |Defines a multiline input control (text area)
<button> |Defines a clickable button
<select> |Defines a drop-down list
<optgroup> |Defines a group of related options in a drop-down list
<option> |Defines an option in a drop-down list
<label> |Defines a label for an <input> element
<fieldset> |Groups related elements in a form
<legend> |Defines a caption for a <fieldset> element
<datalist> |Specifies a list of pre-defined options for input controls
<output> |Defines the result of a calculation