From eefcb4f92271b0312cccae3e18783a1ddeee1b7e Mon Sep 17 00:00:00 2001 From: Matsuko Friedland Date: Sat, 10 Jun 2017 20:27:01 -0700 Subject: [PATCH 1/2] Remove redundant background styles when size is cover --- project/examples/css/ex6.css | 4 ++-- project/examples/css/ex7.css | 4 ++-- project/final/css/final.css | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/project/examples/css/ex6.css b/project/examples/css/ex6.css index 269e9dd..233eea4 100644 --- a/project/examples/css/ex6.css +++ b/project/examples/css/ex6.css @@ -50,9 +50,9 @@ nav a { } /* HOME PAGE STYLES ------------------------------------------*/ +-----------------------------------------*/ .home { - background: url(../images/background-6.jpg) no-repeat 50%; + background: url(../images/background-6.jpg); background-size: cover; } diff --git a/project/examples/css/ex7.css b/project/examples/css/ex7.css index 206f89b..f2f2c75 100644 --- a/project/examples/css/ex7.css +++ b/project/examples/css/ex7.css @@ -50,9 +50,9 @@ nav a { } /* HOME PAGE STYLES ------------------------------------------*/ +-----------------------------------------*/ .home { - background: url(../images/background-6.jpg) no-repeat 50%; + background: url(../images/background-6.jpg); background-size: cover; } diff --git a/project/final/css/final.css b/project/final/css/final.css index 351b284..5a811e3 100644 --- a/project/final/css/final.css +++ b/project/final/css/final.css @@ -65,7 +65,7 @@ nav a { /* HOME PAGE STYLES -----------------------------------------*/ .home { - background: url(../images/background-6.jpg) no-repeat 50%; + background: url(../images/background-6.jpg); background-size: cover; } From be510efbbc0f2a8cb608a8affcbdd0a9b6106d40 Mon Sep 17 00:00:00 2001 From: Matsuko Friedland Date: Sat, 10 Jun 2017 20:55:19 -0700 Subject: [PATCH 2/2] Change background centering to keywords --- project/examples/css/ex6.css | 1 + project/examples/css/ex7.css | 1 + project/final/css/final.css | 1 + slides.html | 11 ++++++----- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/project/examples/css/ex6.css b/project/examples/css/ex6.css index 233eea4..07750a8 100644 --- a/project/examples/css/ex6.css +++ b/project/examples/css/ex6.css @@ -53,6 +53,7 @@ nav a { -----------------------------------------*/ .home { background: url(../images/background-6.jpg); + background-position: center center; background-size: cover; } diff --git a/project/examples/css/ex7.css b/project/examples/css/ex7.css index f2f2c75..7b29337 100644 --- a/project/examples/css/ex7.css +++ b/project/examples/css/ex7.css @@ -53,6 +53,7 @@ nav a { -----------------------------------------*/ .home { background: url(../images/background-6.jpg); + background-position: center center; background-size: cover; } diff --git a/project/final/css/final.css b/project/final/css/final.css index 5a811e3..85405d3 100644 --- a/project/final/css/final.css +++ b/project/final/css/final.css @@ -66,6 +66,7 @@ nav a { -----------------------------------------*/ .home { background: url(../images/background-6.jpg); + background-position: center center; background-size: cover; } diff --git a/slides.html b/slides.html index 1919b98..257bd8f 100644 --- a/slides.html +++ b/slides.html @@ -2157,14 +2157,14 @@

Web Developer + City Girl

``` /* 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; } ``` @@ -2193,7 +2193,7 @@

Web Developer + City Girl

.home { background-image: url(../images/background-6.jpg); background-repeat: no-repeat; - background-position: 50%; + background-position: center center; background-size: cover; } ``` @@ -2201,7 +2201,7 @@

Web Developer + City Girl

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; } ``` @@ -2232,7 +2232,8 @@

Web Developer + City Girl

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