HTML Comments

Comment tags are used to insert comments in the HTML source code. HTML Comment Tags You can add comments to your HTML source by using the following syntax: <!– Write your comments here –> Notice that there is an exclamation point (!) in the opening tag, but not in the closing tag. Note: Comments are not […]

HTML Quotation and Citation Elements

HTML <q> for Short Quotations The HTML <q> element defines a short quotation. Browsers usually insert quotation marks around the <q> element. Example <p>WWF’s goal is to: <q>Build a future where people live in harmony with nature.</q></p> Try it Yourself » HTML <blockquote> for Quotations The HTML <blockquote> element defines a section that is quoted from another source. Browsers usually indent <blockquote> elements. Example […]

HTML Text Formatting

Text Formatting This text is bold This text is italic This is subscript and superscript HTML Formatting Elements In the previous chapter, you learned about the HTML style attribute. HTML also defines special elements for defining text with a special meaning. HTML uses elements like <b> and <i> for formatting output, like bold or italic text. Formatting elements were designed to display special types of text: <b> – Bold text <strong> – […]

HTML Styles

The HTML Style Attribute Setting the style of an HTML element, can be done with the style attribute. The HTML style attribute has the following syntax: <tagname style=”property:value;“> The property is a CSS property. The value is a CSS value. You will learn more about CSS later in this tutorial. HTML Background Color The background-color property defines the background color for an HTML element. This example sets […]

HTML Paragraphs

The HTML <p> element defines a paragraph: Example <p>This is a paragraph.</p> <p>This is another paragraph.</p> Try it Yourself » Note: Browsers automatically add some white space (a margin) before and after a paragraph. HTML Display You cannot be sure how HTML will be displayed. Large or small screens, and resized windows will create different results. With HTML, you […]

HTML Headings

Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 HTML Headings Headings are defined with the <h1> to <h6> tags. <h1> defines the most important heading. <h6> defines the least important heading. Example <h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6> Try it Yourself » Note: Browsers automatically add some white space (a margin) before and […]

HTML Attributes

Attributes provide additional information about HTML elements. HTML Attributes All HTML elements can have attributes Attributes provide additional information about an element Attributes are always specified in the start tag Attributes usually come in name/value pairs like: name=”value” The href Attribute HTML links are defined with the <a> tag. The link address is specified in the href attribute: Example <a href=”https://www.google.com”>This is a link</a> Try […]

HTML Elements

An HTML element usually consists of a start tag and end tag, with the content inserted in between: <tagname>Content goes here…</tagname> The HTML element is everything from the start tag to the end tag: <p>My first paragraph.</p> Start tag Element content End tag <h1> My First Heading </h1> <p> My first paragraph. </p> <br> HTML elements with no content are called […]

HTML Basic Examples

Don’t worry if these examples use tags you have not learned. You will learn about them in the next chapters. HTML Documents All HTML documents must start with a document type declaration: <!DOCTYPE html>. The HTML document itself begins with <html> and ends with </html>. The visible part of the HTML document is between <body> and </body>. Example <!DOCTYPE html> <html> <body> <h1>My […]

HTML Editors

Write HTML Using Notepad or TextEdit Web pages can be created and modified by using professional HTML editors. However, for learning HTML we recommend a simple text editor like Notepad (PC) or TextEdit (Mac). We believe using a simple text editor is a good way to learn HTML. Follow the four steps below to create […]

HTML Introduction

What is HTML? HTML is the standard markup language for creating Web pages. HTML stands for Hyper Text Markup Language HTML describes the structure of Web pages using markup HTML elements are the building blocks of HTML pages HTML elements are represented by tags HTML tags label pieces of content such as “heading”, “paragraph”, “table”, […]