Good! Let's adjust the padding. Remember, the padding is the space between your border and your innermost layer: the actual content.
Padding can be set in two ways, just like your margins. You can either select them individually, like this:
padding-top: /*some value*/
padding-right: /*some value*/
padding-bottom: /*some value*/
padding-left: /*some-value*/
Or select them all in one declaration, like this:
padding: value value value value;
You should also know that if you want your padding to be the same for all four sides, you can declare that value only once. padding: 10px will give your HTML element 10 pixels of padding on all sides.
Instructions
Go ahead and use your preferred method to give your div
padding
of 40px
on all sides.
* {
border: 1px dashed black;
}
div {
height: 50px;
width: 100px;
border: 4px solid #FF0000;
border-radius: 5px;
background-color: #308014;
margin-top:20px;
margin-right:50px;
margin-bottom:10px;
margin-left:5px;
padding:40px;
}
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<title>Result</title>
</head>
<body>
<div></div>
</body>
</html>
No comments:
Post a Comment