HTML Divs

				
					The <div> element is short of "division". It works as a container that divides the page into sections. 
When working with multiple layers of elements, div element is very helpful to organize or group elements in your HTML document. 
				
			
				
					<body>
    <div>
        <h1>Welcome to Jamfinity!</h1>
        <p>Let's Learn HTML!</p>
    </div>
</body>
				
			
				
					Although <div></div> elements do not have any visual representation, it allows us to group up HTML elements and apply CSS styles to them altogether at once. 
For exmaple:
You can assign the class attribute like this: <div class="myDiv"></div>
Then in your .css file, you can style the contents from that specific <div>
As a result, it gives you more flexibility in style different section of your HTML document. 
Moreover, you can have a more organized/ group contents and elements.
				
			
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments