An HTML element is defined by a start tag, some content, and an end tag. An HTML element is defined by a start tag, some content, and an end tag:
Note that some HTML elements have no content (like the <br> element). These elements are called empty elements. Empty elements do not have an end tag. For the tags that require end tags you must not forget their end tags or else elements will not display correctly.
HTML elements can be nested which means that elements can contain other elements. HTML tags are not case sensitive:
<P> means the same as
HTML headings are titles or subtitles that you want to display on a webpage. HTML headings are defined with the
<h1> defines the most important heading.
<h6> defines the least important heading. Browsers automatically add some white space (a margin) before and after a heading.
Search engines use the headings to index the structure and content of your web pages. Users often skim a page by its headings. It is important to use headings to show the document structure.
<h1> headings should be used for main headings, followed by
<h2> headings, then the less important
<h3>, and so on. Use HTML headings for headings only. Don’t use headings to make text BIG or bold.
<h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6>
Each HTML heading has a default size. However, you can specify the size for any heading with the
style attribute, using the CSS
<h1 style="font-size:160px;">Heading 1</h1>
<p> element defines a paragraph. A paragraph always starts on a new line, and browsers automatically add some white space (a margin) before and after a paragraph.
<p>My name is Folau.</p>
<a> tag defines a hyperlink, which is used to link from one page to another. The most important attribute of the
<a> element is the href attribute, which indicates the link’s destination.
<a>tag has no href attribute, it is only a placeholder for a hyperlink.
<a href="index.html" target="_self">Go Home</a>
<img> tag is used to display an image in an HTML page. Images are not technically inserted into a web page; images are linked to web pages. The
<img> tag creates a holding space for the referenced image.
<img> tag has two required attributes:
You need to always specify the width and height of an image. If width and height are not specified, the page might flicker while the image loads.
To link an image to another document, simply nest the
<img> tag inside an <a> tag.
<img src="superman.jpg" alt="superman" width="500" height="600">
A block-level element always starts on a new line and takes up the full width available. These are block-level elements:
An inline element does not start on a new line and it only takes up as much width as necessary. Note that an inline element cannot contain a block-level element.
<button> tag defines a clickable button. Inside a
<button> element you can put text (and tags like <i>, <strong>, <br>, <img>, etc.). This is not possible with a button created with the <input> element.
You must always specify the type attribute for a
<button> element, to tell browsers what type of button it is. You can easily style buttons to look like a link.
<button name="hello" type="button">Hello</button>
<footer> tag defines a footer for a document or section.
<footer> tag contains:
You can have several
<footer> elements in one document.
<footer> <p>Author: Folau</p> <p><a href="mailto:email@example.com">firstname.lastname@example.org</a></p> </footer>