Skip to main content

Posts

4 HTML Elements

  An HTML element is defined by a start tag, some content, and an end tag. 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 > 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 > Example Explained The  <html>  element is the root element and it defines the whole HTML document. It has a start tag  <html>  and an end t...
Recent posts

3 HTML Basic Examples

  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 appear once, at the top of the page (before any HTML tags). The  <!DOCTYPE>  declaration is not case sensitive. The  <!DOCTYPE>  declaration for HTML5 is: < !DOCTYPE  html > HTML Headings HTML headings are defined with the  <h1>  to  <h6>  tags. <h...

2 HTML INTRODUCTION

HTML is the standard markup language for creating Web pages. What is HTML? HTML stands for Hyper Text Markup Language HTML is the standard markup language for creating Web pages HTML describes the structure of a Web page HTML consists of a series of elements HTML elements tell the browser how to display the content HTML elements label pieces of content such as "this is a heading", "this is a paragraph", "this is a link", etc. A Simple HTML Document Example < !DOCTYPE  html > < html > < head > < title > Page Title < /title > < /head > < body > < h1 > My First Heading < /h1 > < p > My first paragraph. < /p > < /body > < /html > Try it Yourself » Example Explained The  <!DOCTYPE html>  declaration defines that this document is an HTML5 document The  <html>  element is the root element of an HTML page The  <head>  element contains meta information about the HTML...