Skip to content

Commit 956705c

Browse files
committed
Background Images - background-position
1 parent 3d7b3a3 commit 956705c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

styles.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* background-size */
1+
/* background-position */
22

33
div {
44
height: 300px;
@@ -10,12 +10,20 @@ div {
1010
background: url("./big.jpeg");
1111
background-repeat: no-repeat;
1212
background-size: cover;
13+
background-position: 20% 50%;
14+
background-position: center;
1315
}
1416

1517
.small-img {
1618
background: url("./small.jpeg");
1719
background-repeat: no-repeat;
18-
background-size: cover;
20+
background-position: center;
21+
background-position: left;
22+
background-position: right;
23+
background-position: bottom;
24+
background-position: top;
25+
background-position: 0 0; /* Default behavior */
26+
background-position: 20% 50%;
1927
}
2028

2129
.folder-img {

0 commit comments

Comments
 (0)