Monday, 25 July 2022

HTML5 Overview


Simple HTML Document

The following is an example of a HTML document.


<!DOCTYPE html>
<html>

   <head>
      <title>This is document title</title>
   </head>
	
   <body>
      <h1>This is a heading</h1>
      <p>Document content goes here.....</p>
   </body>
	
</html>

HTML Tags 

HTML, as previously stated, is a markup language that structures information using various tags. Angle brackets are used to enclose these tags. With the exception of a few tags, the bulk of tags have identical closing tags. has a closing tag, and tag has a closing tag tag, and so forth.

To learn HTML, you must first explore various tags and understand how they operate when organising text. Learning HTML is simple since users must learn how to use different tags to format text or images in order to make a nice webpage.


Beginning with HTML 4, the World Wide Web Consortium (W3C) suggests using lowercase tags.


HTML Document Structure

HTML document structure −

<html>
   
   <head>
      Document header related tags
   </head>
   
   <body>
      Document body related tags
   </body>
   
</html>

In following chapters, we will look at all of the header and body tags, but for now, let's look at the document declaration tag.



The <!DOCTYPE> Declaration

The <!DOCTYPE> declaration tag is used by the web browser to understand the version of the HTML used in the document. Current version of HTML is 5 and it makes use of the following declaration.


<!DOCTYPE html>


There are many other declaration types which can be used in HTML document depending on what version of HTML is being used. We will see more details on this while discussing <!DOCTYPE html> tag along with other HTML tags.


HTML5 Quiz

HTML5 Quiz u tag

u tag


The <u> tag represents some text that is unarticulated and styled differently from normal text, such as misspelled words or proper names in Chinese text. The content inside is typically displayed with an underline. You can change this with CSS (see example below). 

Example


<p>The <u> HTML </uword is underlined. </p>


HTML5 id

id

  • The HTML id attribute is used to specify a unique id for an HTML element.
  • You cannot have more than one element with the same id in an HTML document.
  • The id attribute specifies a unique id for an HTML element. 
  • The value of the id attribute must be unique within the HTML document.
  • The id attribute is used to point to a specific style declaration in a style sheet. It is also used by JavaScript to access and manipulate the element with the specific id.


Example

<h1 id="heading">Header</h1>

<style>

#heading {

    color: blue;

}

</style>



HTML5 class

class

The class attribute specifies one or more classnames for an element.

The class attribute is mostly used to point to a class in a style sheet. However, it can also be used by a JavaScript (via the HTML DOM) to make changes to HTML elements with a specified class.


Example

<h1 class="heading"Header </h1>

<p class="imp">Note that this is an important paragraph.</p> 

<style>

.heading {

    color: blue;

} 

.heading {

    color: blue;

}

</style>



HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz

HTML5 Quiz