Answers for "padding margin"

70

css padding

padding: 5px 10px 15px 20px; //top right bottom left

padding: 10px 20px;//top & bottom then left & right

padding-top: 5px; //just top padding
padding-right: 10px; //just right padding
padding-bottom: 15px; //just bottom padding
padding-left: 20px; //just left padding
Posted by: Guest on March-01-2020
27

margin vs padding

Margin is on the outside of block elements, padding is on the inside.

Use margin to separate the block from things outside it
Use padding to move the contents away from the edges of the block.

Main differences:
- Vertical margins of adjacent items will overlap, padding will not
- Padding is included in the click region and background color/image,
but not the margin
Posted by: Guest on December-21-2020
-1

html box

<!DOCTYPE html>
<html>
	<head>
		<title>Page Title</title>
	</head>
	<body>
	    <style>
	        .box {
	            height:5px;
	            width:5px;
	            background-color:blue;
                padding-top: 30px;
                padding-right: 30px;
                padding-bottom: 30px;
                padding-left: 30px;
                color:blue;
                border-width: 15px 15px 15px 15px;
                border-color: blue;
                border-style: solid;
                border-radius: 70%
                outline-color: blue;
                margin-top: 10px;
                margin-bottom: 10px;
                margin-right: 10px;
                margin-left: 10px;
            }
	    </style>
		<div class="box">
		    <h1 style="color:black;position:absolute;font-family:helvetical;font-size:20px;left:20px;bottom:325px;">Your Text</h1>
		</div>
	</body>
</html>
Posted by: Guest on September-20-2020
0

padding left

.yourClass {
  padding-left: 50px; // or
  padding-left: 1%; // to scale it in relation to its parent
}
Posted by: Guest on July-04-2020
1

padding margin and border

GO TO THIS LINK
https://www.geeksforgeeks.org/css-margins-padding/
https://media.geeksforgeeks.org/wp-content/uploads/cssmarginandpadding.png
Posted by: Guest on November-25-2020

Browse Popular Code Answers by Language