Saturday, 11 March 2023

Div Tag in HTML

 

HTML Div Tag

The HTML <div> tag is used to group the large section of HTML elements together.

We know that every tag has a specific purpose e.g. p tag is used to specify paragraph, <h1> to <h6> tag are used to specify headings but the <div> tag is just like a container unit which is used to encapsulate other page elements and divides the HTML documents into sections.

The div tag is generally used by web developers to group HTML elements together and apply CSS styles to many elements at once. For example: If you wrap a set of paragraph elements into a div element so you can take the advantage of CSS styles and apply font style to all paragraphs at once instead of coding the same style for each paragraph element.

Example:

<!Doctype html>

<html>

           <head>

                                <title>Inline CSS</title>

                </head>

                <body>

                    <div>

                                     <h1>Welcome to my website</h1>

                                                 <hr color="blue" size="6">

                                </div>

                               

                                <div>

                                   <h2>This is my first article</h2>

                                   <b> Rajneesh Shrivastava</b>

                   This article was written about HTML & Web designs training in Hindi Languages.

                             <hr color="red" size="6">

                           </div> 

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>

                                 <hr color="red" size="6">

                                <div>

                                    <p align="center">Copywrite 2016 onlineustaad</p>

                                </div>

                                <hr color="red" size="6">

                </body>

</html>




No comments:

Post a Comment

Full Form of IT and ITes Industry

                                                 Full Form (IT and ITeS) ICT - Information Communication Technology IT - Information Tec...