Posts

HTML Elements

Image
HTML Elements An HTML element is defined by a start tag, some content, and an end tag: < tagname > Content goes here... < /tagname > The HTML  element  is everything from the start tag to the end tag: < 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 Note:  Some HTML elements have no content (like the <br> element). These elements are called empty elements. Empty elements do not have an end tag! 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.

HTML Basic Examples

Image
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 > Output : 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. <h1>  defines the most important head

HTML Home

Image
HTML HTML stands for Hyper Text Markup Language HTML is the standard markup language for creating Web pages Step 1: Open Notepad (PC) Windows 8 or later: Open the  Start Screen  (the window symbol at the bottom left on your screen). Type  Notepad . Windows 7 or earlier: Open  Start  >  Programs >   Accessories >   Notepad Step 1: Open TextEdit (Mac) Open  Finder > Applications > TextEdit Also change some preferences to get the application to save files correctly.  In  Preferences > Format >  choose  "Plain Text" Then under "Open and Save", check the box that says "Display HTML files as HTML code instead of formatted text". Then open a new document to place the code. Step 2: Write Some HTML < !DOCTYPE  html > < html > < head > < title > Page Title < /title > < /head > < body > < h1 > My First Heading < /h1 > < p > My first paragraph. < /p > < /b