Posts

Showing posts from January 28, 2018

HTML Elements, nested elements and empty elements

HTML Elements, nested elements and empty elements HTML Elements HTML Elements An HTML element usually consists of a start tag and end tag, with the content inserted in between &colon; <tagname>content goes here...</tagname> The HTML element is everything from the start tag to the end tag &colon; <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 empty elements. Empty elements do not have an end tag, such as the <br/ > element(which indicates a line break). Nested HTML Elements HTML elements can be nested (elements can contain elements). All HTML documents consists of nested HTML elements. This example contains four HTML elements &colon; Example &colon; Answer &colon; <!DOCTYPE html> <html> <body&

Some Basic HTML Examples

Some HTML Basic Examples HTML Basic Examples Don't worry, if you are not familiar with these tags. You will be learning them in the next upcoming chapters. HTML Documents Each and every HTML document must have to start with a document type declaration &colon; <!DOCTYPE html> . The HTML document itself begins with <html> and ends with </html> The visible part of the HTML document is always between <body> and </body> tag. <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html> HTML Headings HTML headings are defined according to the importance of the headings with the <h1> to <h6> tags. <h1> defines the most important heading. <h6> defines the least important heading &colon; Example &am