Moment Of Life !!

Friday, 9 December 2016

  HTML Elements

      HTML Elements An HTML element is everything from the start tag to the end tag: Start tag Element content End tag

This is a paragraph

This is a link   HTML Element Syntax An HTML element starts with a start tag An HTML element ends with an end tag The element content is everything between the start and end tag Some HTML elements have empty content Some HTML elements have a missing end tag Note: The start tag can have additional information (attributes). See next chapter. Nested HTML Elements Most HTML elements can be nested (can contain other HTML elements). Most HTML documents consist of nested HTML elements. HTML Document Example

This is my first paragraph

The example above contains 3 HTML elements:

This is my first paragraph

The

element defines a paragraph in the HTML document: The element has a start tag

and an end tag

The element content is: This is my first paragraph

This is my first paragraph

The element defines the body of the HTML document The element has a start tag and an end tag The element content is another element (a paragraph)

This is my first paragraph

The element defines the whole HTML document. The element has a start tag and an end tag The element content is another element (the body) Empty HTML Elements HTML elements without content are called empty elements. Empty elements have no end tag.
is an empty element without a closing tag. In XHTML, XML, and future versions of HTML, all elements must be closed. Adding a slash to the start tag, like
, is the proper way of closing empty elements, accepted by HTML, XHTML and XML. Even if
works in all browsers, writing
instead is more future proof.   HTML Tip - Lowercase Tags HTML tags are not case sensitive:

means the same as

. Plenty of web sites use uppercase HTML tags in their pages. W3Schools use lowercase tags because the World Wide Web Consortium (W3C) recommends lowercase in HTML 4, and demands lowercase tags in newer versions of (X)HTML.  

Share:

0 comments:

Blog Archive

Recent Comments

Site Counter

Flag Counter

Support