-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solution #4961
base: master
Are you sure you want to change the base?
solution #4961
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<!--#region head--> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
|
@@ -12,7 +13,78 @@ | |
href="./style.css" | ||
/> | ||
</head> | ||
<!--#endregion--> | ||
<body> | ||
<h1>Stars</h1> | ||
<div class="stars stars--0"> | ||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
</div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. HTML Content: It would be better to use semantic tags instead of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the checklist, you should add empty lines between multiline sibling blocks of HTML to simplify reading. However, you have added empty lines between child elements, which is not recommended. You should remove the empty lines between the |
||
|
||
<div class="stars stars--1"> | ||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
</div> | ||
|
||
<div class="stars stars--2"> | ||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
</div> | ||
|
||
<div class="stars stars--3"> | ||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
</div> | ||
|
||
<div class="stars stars--4"> | ||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
</div> | ||
|
||
<div class="stars stars--5"> | ||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
|
||
<div class="stars__star"></div> | ||
</div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,46 @@ | ||
/* add styles here */ | ||
html, | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the checklist, you should avoid using the |
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a checklist item that suggests not to use tag names for styling, except for |
||
|
||
.stars { | ||
display: flex; | ||
} | ||
|
||
.stars__star { | ||
display: flex; | ||
background-image: url(images/star.svg); | ||
width: 16px; | ||
height: 16px; | ||
border-radius: 0.5px; | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
margin-right: 4px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remember to use fallback fonts. It's an alternative font-family in case the main one doesn't work. You can specify a list of fonts separated by commas. The browser will use the first font in the list available on the user's computer. |
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Be consistent with your margins. It seems you are applying the |
||
|
||
.stars--1 :first-child { | ||
background-image: url(./images/star-active.svg); | ||
} | ||
Comment on lines
+24
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The path to the images is not consistent. Here you're using |
||
|
||
.stars--2 :nth-child(-n + 2) { | ||
background-image: url(images/star-active.svg); | ||
} | ||
|
||
.stars--3 :nth-child(-n + 3) { | ||
background-image: url(images/star-active.svg); | ||
} | ||
|
||
.stars--4 :nth-child(-n + 4) { | ||
background-image: url(images/star-active.svg); | ||
} | ||
|
||
.stars--5 :nth-child(-n + 1), | ||
.stars--5 :nth-child(-n + 2), | ||
.stars--5 :nth-child(-n + 3), | ||
.stars--5 :nth-child(-n + 4), | ||
.stars--5 :nth-child(-n + 5) { | ||
Comment on lines
+40
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seems to be a mistake in your CSS selectors. The |
||
background-image: url(images/star-active.svg); | ||
} | ||
Comment on lines
+40
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can simplify the CSS rule for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a good practice to avoid fixing container size if there is no such a requirement. Let the content size dictate it. This can help to avoid overflow or accidental scroll bar. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTML Formatting: The attributes of your
link
tag are not correctly formatted. Each attribute should start on a new line with a 2-space indentation relative to the tag.