How to set the bottom margin of an element?



The margin-bottom property is used to set the bottom margin of an element. It can have a value in length, % or auto.

Example

You can try to run the following code to set the bottom margin

<html>    <head>    </head>    <body>       <p style = "margin-bottom: 40px; border:2px solid yellow;">          Cricket crazy nation India!       </p>       <p style = "margin-bottom: 20%; border:2px solid yellow;">          Cricket crazy nation Australia!       </p>    </body> </html>
Updated on: 2020-02-03T07:00:37+05:30

208 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements