Category: HTML Tutorials
-
HTML Text Formatting
HTML contains several elements for defining text with a special meaning. Example This text is bold This text is italic This is subscript and superscript HTML Formatting Elements Formatting elements were designed to display special types of text: HTML <b> and <strong> Elements The HTML <b> element defines bold text, without any extra importance. Example <b>This text is bold</b> The…
-
HTML Styles
The HTML style attribute is used to add styles to an element, such as color, font, size, and more. Example I am Red I am Blue I am Big 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…
-
HTML Paragraphs
A paragraph always starts on a new line, and is usually a block of text. HTML Paragraphs The HTML <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. Example <p>This is a paragraph.</p><p>This is another paragraph.</p> HTML Display You…
-
HTML Headings
HTML headings are titles or subtitles that you want to display on a webpage. Example Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 HTML Headings HTML 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> Note: Browsers automatically add…
-
HTML Tag Reference
Tag Description <html> Defines the root of an HTML document <body> Defines the document’s body <h1> to <h6> Defines HTML headings
-
Nested HTML Elements
HTML elements can be nested (this means that elements can contain other elements). All HTML documents consist of nested HTML elements. The following example contains four HTML elements (<html>, <body>, <h1> and <p>): Example <!DOCTYPE html><html><body> <h1>My First Heading</h1><p>My first paragraph.</p> </body></html>
-
HTML Elements
The HTML element is everything from the start tag to the end tag: <tagname>Content goes here…</tagname> Examples of some HTML elements: <h1>My First Heading</h1> <p>My first paragraph.</p> Start tag Element content End tag <h1> My First Heading </h1> <p> My first paragraph. </p> <br> none none
-
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 First Heading</h1><p>My first paragraph.</p> </body></html> The <!DOCTYPE> Declaration The <!DOCTYPE> declaration represents the document type, and helps browsers to display web pages correctly. It must only…
-
What is HTML?