From a9cf40f4d9a5ba864f440fc5a4314fb5f6ddeee7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 1 Nov 2024 11:49:11 -0300 Subject: [PATCH] add solution --- src/index.html | 43 ++++++++++++++++++++++++++++++++++++++++++- src/style.css | 32 +++++++++++++++++++++++++++++++- 2 files changed, 73 insertions(+), 2 deletions(-) diff --git a/src/index.html b/src/index.html index 3e4d7e8ab0..85a3f43feb 100644 --- a/src/index.html +++ b/src/index.html @@ -13,6 +13,47 @@ /> -

Stars

+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
diff --git a/src/style.css b/src/style.css index a63fa10d43..bc709ada63 100644 --- a/src/style.css +++ b/src/style.css @@ -1 +1,31 @@ -/* add styles here */ +body { + margin: 0; +} + +.stars { + display: flex; + position: relative; + text-align: center; +} + +.stars__star { + width: 16px; + height: 16px; + margin-right: 4px; + background-image: url('./images/star.svg'); + background-repeat: no-repeat; + background-position: center; +} + +.stars__star:last-child { + margin-right: 0; +} + +.stars--0 .stars__star:nth-child(-n + 0), +.stars--1 .stars__star:nth-child(-n + 1), +.stars--2 .stars__star:nth-child(-n + 2), +.stars--3 .stars__star:nth-child(-n + 3), +.stars--4 .stars__star:nth-child(-n + 4), +.stars--5 .stars__star:nth-child(-n + 5) { + background-image: url('./images/star-active.svg'); +}