-
Notifications
You must be signed in to change notification settings - Fork 4k
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
add solution #4489
base: master
Are you sure you want to change the base?
add solution #4489
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 |
---|---|---|
|
@@ -17,16 +17,20 @@ | |
/> | ||
</head> | ||
<body> | ||
<input | ||
type="text" | ||
data-qa="keypress" | ||
placeholder="Try “Los Angeles“" | ||
/> | ||
<form method="post"> | ||
<input | ||
class="input big-input" | ||
type="text" | ||
data-qa="big" | ||
placeholder="Try “Los Angeles“" | ||
/> | ||
Comment on lines
+20
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. Keep your attributes correctly formatted. If the HTML element has long attribute values or the number of attributes is more than 2, start each one, including the first, on a new line with 2-space indentation related to the tag. |
||
|
||
<input | ||
type="text" | ||
data-qa="hover" | ||
placeholder="Try “Los Angeles“" | ||
/> | ||
<input | ||
class="input small-input" | ||
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. Similar to the previous comment, the class name 'small-input' should be reconsidered to reflect the content or function rather than the style. |
||
type="text" | ||
data-qa="small" | ||
placeholder="Try “Los Angeles“" | ||
Comment on lines
+28
to
+32
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. Keep your attributes correctly formatted. If the HTML element has long attribute values or the number of attributes is more than 2, start each one, including the first, on a new line with 2-space indentation related to the tag. |
||
/> | ||
</form> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,100 @@ | ||
/* add styles here */ | ||
@font-face { | ||
font-family: Avenir; | ||
src: url("fonts/Avenir-Book.ttf") format("truetype"); | ||
font-weight: normal; | ||
font-style: normal; | ||
} | ||
|
||
@font-face { | ||
font-family: Avenir; | ||
src: url("fonts/Avenir-Heavy.ttf") format("truetype"); | ||
font-weight: bold; | ||
font-style: normal; | ||
} | ||
|
||
body { | ||
font-family: Avenir, Arial, Helvetica, sans-serif; | ||
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 - alternative font-family in case the main one doesn't work. You have a good set of fallback fonts here, but it's a good practice to also include a generic font family at the end, such as 'sans-serif' to ensure maximum compatibility.
Comment on lines
+16
to
+17
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 - alternative font-family in case the main one doesn't work. You've done this correctly here, but make sure to apply this practice throughout your project. |
||
} | ||
|
||
input { | ||
display: block; | ||
width: 100%; | ||
margin-top: 20px; | ||
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 (Add only top or bottom, but not both). Here you've added a top margin, ensure that you're not also adding bottom margins elsewhere for the same element to avoid potential margin collapse. 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 (Add only top or bottom, but not both). In this case, you have added a top margin to the input. Ensure that you use margins consistently throughout your CSS to avoid potential margin collapse. |
||
font-family: Avenir, Arial, Helvetica, sans-serif; | ||
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 no need to set the font-family for input if it's the same as the body's font-family, unless you want to override a specific style from a more specific selector. |
||
border: 1px solid rgba(225, 231, 237, 1); | ||
border-radius: 4px; | ||
} | ||
|
||
.big-input { | ||
height: 70px; | ||
box-shadow: 0 1px 8px 0 rgba(61, 78, 97, 0.1); | ||
box-sizing: border-box; | ||
padding-left: 62px; | ||
background-image: url("./images/Search.svg"); | ||
background-repeat: no-repeat; | ||
background-position: 25px center; | ||
font-size: 16px; | ||
color: rgba(61, 78, 97, 1); | ||
font-weight: bold; | ||
} | ||
|
||
.big-input::placeholder { | ||
color: rgba(61, 78, 97, 1); | ||
font-weight: normal; | ||
} | ||
|
||
.big-input:hover { | ||
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25); | ||
} | ||
|
||
.big-input:focus { | ||
outline: none; | ||
background-image: url("./images/Search.svg"), | ||
linear-gradient(180deg, #fff 0%, #f6f6f7 100%); | ||
background-repeat: no-repeat; | ||
background-position: | ||
25px center, | ||
0 0; | ||
background-size: | ||
19px 19px, | ||
100% 100%; | ||
text-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25); | ||
} | ||
|
||
.small-input { | ||
height: 42px; | ||
box-shadow: 0 1px 8px 0 rgba(61, 78, 97, 0.1); | ||
box-sizing: border-box; | ||
padding-left: 33px; | ||
background-image: url("./images/Search.svg"); | ||
background-repeat: no-repeat; | ||
background-position: 12px center; | ||
background-size: 11px 11px; | ||
color: rgba(61, 78, 97, 1); | ||
font-weight: bold; | ||
font-size: 14px; | ||
} | ||
|
||
.small-input::placeholder { | ||
color: rgba(61, 78, 97, 1); | ||
font-weight: normal; | ||
} | ||
|
||
.small-input:hover { | ||
box-shadow: 0 3px 8px 0 rgba(61, 78, 97, 0.2); | ||
} | ||
|
||
.small-input:focus { | ||
outline: none; | ||
background-image: url("./images/Search.svg"), | ||
linear-gradient(180deg, #fff 0%, #f6f6f7 100%); | ||
background-repeat: no-repeat; | ||
background-position: | ||
12px center, | ||
0 0; | ||
background-size: | ||
11px 11px, | ||
100% 100%; | ||
text-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25); | ||
} |
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.
Class names should represent the meaning of the content, not the styles or tag names. The class name 'big-input' seems to describe the style rather than the content or function of the input.