HTML Styling div elements Code For Website - Learn About Website | DaddyFile

0

The <div> Element Explain

The <div> element is a block-level element that is often used as a container for other HTML elements.
The <div> element has no required attributes, but style and class are common.
When used together with CSS, the <div> element can be used to style blocks of content.



Html Code:

<!DOCTYPE html>
<html>
<body>

<div style="background-color:black; color:white; padding:20px;">

<h2>London</h2>

<p>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.</p>
<p>Standing on the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Romans, who named it Londinium.</p>

</div>

</body>
</html>




Html Code Result:

Post a Comment

 
Top