2.1 Tags and Elements

posted September 1, 2014

Tags

HTML source code uses tag names surrounded by angle brackets: <tagname>. HTML elements are written with a start tag, with an end tag, with the content in between:

<tagname>content</tagname>

Elements

The HTML element is everything from the start tag to the end tag:

<p>My first HTML paragraph.</p>
The content is affected by the tags it is enveloped by. So the tagname used, matters.
In the case above, the <p> tag indicates a paragraph is opening and </p> indicates a paragraph is closing. (Otherwise known as the opening and closing tags.)
There are also tags that standalone and do not have a closing tag like the <img> tag (for images).

HTML Elements by Function


Notes and Resources

  1. The standard file extension of HTML documents is .html and your web browser is the app that interprets and displays your web page document. Just as .doc or .docx are file extensions of Microsoft Word. There are many file extensions available on the web such as .php, .asp, .htm and many more.
  2. CSS3 and HTML5 have helped to replace some of the more simple JavaScript commands. JavaScript is alive and well and developing in areas like 3D web development (three.js), powerful frameworks (node.js) and game development engines.
  3. Certain start tags and end tags can in certain cases be omitted and are implied by other tags.
  4. HTML - W3C