Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions project/examples/css/ex6.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ nav a {
}

/* HOME PAGE STYLES
-----------------------------------------*/
-----------------------------------------*/
.home {
background: url(../images/background-6.jpg) no-repeat 50%;
background: url(../images/background-6.jpg);
background-position: center center;
background-size: cover;
}

Expand Down
5 changes: 3 additions & 2 deletions project/examples/css/ex7.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ nav a {
}

/* HOME PAGE STYLES
-----------------------------------------*/
-----------------------------------------*/
.home {
background: url(../images/background-6.jpg) no-repeat 50%;
background: url(../images/background-6.jpg);
background-position: center center;
background-size: cover;
}

Expand Down
3 changes: 2 additions & 1 deletion project/final/css/final.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ nav a {
/* HOME PAGE STYLES
-----------------------------------------*/
.home {
background: url(../images/background-6.jpg) no-repeat 50%;
background: url(../images/background-6.jpg);
background-position: center center;
background-size: cover;
}

Expand Down
11 changes: 6 additions & 5 deletions slides.html
Original file line number Diff line number Diff line change
Expand Up @@ -2157,14 +2157,14 @@ <h2>Web Developer + City Girl</h2>
```
/* shorthand */
.home {
background: url(../images/background-6.jpg) no-repeat 50%;
background: url(../images/background-6.jpg) no-repeat center center;
}

/* longhand */
.home {
background-image: url(../images/background-6.jpg);
background-repeat: no-repeat;
background-position: 50%;
background-position: center center;
}
```

Expand Down Expand Up @@ -2193,15 +2193,15 @@ <h2>Web Developer + City Girl</h2>
.home {
background-image: url(../images/background-6.jpg);
background-repeat: no-repeat;
background-position: 50%;
background-position: center center;
background-size: cover;
}
```

To include it using the shorthand property, there's a quirk. It _must_ be included after `background-position`, separated with the `/` character.
```
.home {
background: url(../images/background-6.jpg) no-repeat 50% / cover;
background: url(../images/background-6.jpg) no-repeat center center/ cover;
}
```
</script>
Expand Down Expand Up @@ -2232,7 +2232,8 @@ <h2>Web Developer + City Girl</h2>

```
.home {
background: url(../images/background-6.jpg) no-repeat;
background: url(../images/background-6.jpg);
background-size: center center;
background-size: cover;
}
```
Expand Down