Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
August 15, 2021 01:05 am GMT

Understanding HTML

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 adivision 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.

Thedivtag 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.


Original Link: https://dev.to/biochris/understanding-html-div-4f76

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To