- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Positioning the background relative to different borders</title>
<meta charset="utf-8">
<link rel="stylesheet" href="setting.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="portrait"></div>
</body>
</html>
CSS
.portrait {
box-sizing: border-box;
margin: 20px auto;
padding: 40px;
width: 400px;
height: 400px;
border: 40px solid rgba(255, 255, 0, 0.4);
background-color: #ffffff;
background-image:
url("img/glasses.svg"),
url("img/muffin.jpg");
background-position:
75px 125px,
center;
background-clip: padding-box;
background-origin: border-box;
background-size:
150px,
cover;
background-repeat: no-repeat;
}
You’ve gone to a different page
Goalscompleted
0
- Change the first background in the portrait from
img/glasses.svg
toimg/mustache.svg
, - Then change the size of the first background to
110px
- and set its position to
170px
from the bottom and205px
from the right.
Comments