ASSIGNMENT

FIVE (5) HTML TAGS AND THEIR USES

HTML ELEMENTS AND THEIR USES.

a. <div>: This element is used as a container for other HTML elements. It is often used to group block-level elements to apply CSS styles or Javascript.

b. <a>: This element is used to create hyperlinks, which are clickable links that navigate to another page or resource.

c. <p>: This element is used to define a paragraph of text.

d. <img>: This element is used to embed images in an HTML document.

e. <form>: This is used to create an interactive form for user input. It can contain various form elements like text fields, checkboxes and submit buttons.

EXPLANATION OF FIVE TAGS WITH EXAMPLES:


1. <html> and </html>:

   – <html> tag is the root element of an HTML page, and all other elements are contained within it.

   – </html> marks the end of the HTML document.

    Example:

     html

     <!DOCTYPE html>

     <html>

     <head>

         <title>My Web Page</title>

     </head>

     <body>

         <!– Content goes here –>

     </body>

     </html>

2. <p> and </p>:
   – <p> defines a paragraph of text.
   – </p> closes the paragraph.
    Example:
     html
     <p>This is a paragraph of text.</p>

3. <a> and </a>:
   – <a> defines a hyperlink.
   – </a> closes the hyperlink.
   -Example:
     html
     <a href=”https://example.com”>Click here</a> to visit Example.com.

4. <div> and </div>:
   – <div> defines a division or section in an HTML document.
   – </div> marks the end of that division.
   -Example:
     html
     <div>
         <p>This is inside a div section.</p>
         <p>Another paragraph in the same div.</p>
     </div>

5. <ul> and </ul>:
   – <ul> defines an unordered list.
   – </ul> closes the unordered list.
   Example:
     html
     <ul>
         <li>Item 1</li>
         <li>Item 2</li>
         <li>Item 3</li>
     </ul>