Understanding HTML <DIV>

HTML DIV

In writing the HTML(Hyper Text Markup Language) of a web page, the use of the HTML tag called Div is one of the important HTML tag that every programmer should understand the schematics and it’s purpose in writing our HTML codes.

I came acr…


This content originally appeared on DEV Community and was authored by BioChris

HTML DIV

In writing the HTML(Hyper Text Markup Language) of a web page, the use of the HTML tag called Div is one of the important HTML tag that every programmer should understand the schematics and it's purpose in writing our HTML codes.

I came across a beginner to front end web development that said she had to stop her learning process due to lack of understanding of the HTML tag DIV, so I am writing this for absolute beginners to understand exactly what DIV is used for and there purpose and importance in writing a good HTML code.

The div tag defines a division or a section in a standard HTML code. The div tag is used as a container for HTML elements. When ever you need to divide or separate the elements on a webpage, you use the HTML tag (div).

While writing our codes for instance, we have the menu section, the about section, the skill section, the projects section, the contact section and the footer section. It is advisable to always wrap up each sections with a DIV.

The div tag is easily styled by using the class or id attribute. When ever you want to effect a change in the style of a particular section, it is easier to Target the DIV class or ID, by so doing the changes affects all the elements and contents that is placed within the opening and closing div;
Alt Text
Any sort of content can be put inside the 

tag!

NOTE:By default,browsers always place a line break before and after the div  element.

A DIV is simply a container that holds different sections and elements in an HTML document.
You get to also see the beauty of a div when we start having sections and sub sections. Here you can have a div as a child inside a parent div.
Alt Text

We make use of DIV for easy styling of each sections, subsections and to make our codes orderly, readable and reusable.


This content originally appeared on DEV Community and was authored by BioChris


Print Share Comment Cite Upload Translate Updates
APA

BioChris | Sciencx (2021-08-15T01:05:26+00:00) Understanding HTML <DIV>. Retrieved from https://www.scien.cx/2021/08/15/understanding-html-div/

MLA
" » Understanding HTML <DIV>." BioChris | Sciencx - Sunday August 15, 2021, https://www.scien.cx/2021/08/15/understanding-html-div/
HARVARD
BioChris | Sciencx Sunday August 15, 2021 » Understanding HTML <DIV>., viewed ,<https://www.scien.cx/2021/08/15/understanding-html-div/>
VANCOUVER
BioChris | Sciencx - » Understanding HTML <DIV>. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/08/15/understanding-html-div/
CHICAGO
" » Understanding HTML <DIV>." BioChris | Sciencx - Accessed . https://www.scien.cx/2021/08/15/understanding-html-div/
IEEE
" » Understanding HTML <DIV>." BioChris | Sciencx [Online]. Available: https://www.scien.cx/2021/08/15/understanding-html-div/. [Accessed: ]
rf:citation
» Understanding HTML <DIV> | BioChris | Sciencx | https://www.scien.cx/2021/08/15/understanding-html-div/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.