-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
product card #4891
product card #4891
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 |
---|---|---|
|
@@ -7,12 +7,67 @@ | |
content="width=device-width, initial-scale=1.0" | ||
/> | ||
<title>Product cards</title> | ||
|
||
<link | ||
rel="preconnect" | ||
href="https://fonts.googleapis.com" | ||
/> | ||
<link | ||
rel="preconnect" | ||
href="https://fonts.gstatic.com" | ||
/> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" | ||
rel="stylesheet" | ||
/> | ||
|
||
<link | ||
rel="stylesheet" | ||
href="./styles/index.scss" | ||
href="/src/styles/index.scss" | ||
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 href attribute should link to a CSS file, not a SCSS file. Browsers cannot directly interpret SCSS files, so you need to compile your SCSS into CSS and link to the resulting CSS file. |
||
/> | ||
</head> | ||
<body> | ||
<h1>Product cards</h1> | ||
<div | ||
class="card" | ||
data-qa="card" | ||
> | ||
<img | ||
src="/src/images/imac.jpeg" | ||
alt="imac" | ||
class="card__img" | ||
/> | ||
|
||
<h2 class="card__text"> | ||
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) | ||
</h2> | ||
|
||
<h3 class="card__code">Product code: 195434</h3> | ||
|
||
<div class="stars"> | ||
<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 class="stars__reviews">Reviews: 5</div> | ||
</div> | ||
|
||
<div class="card__price"> | ||
<span class="card__price-text">Price:</span> | ||
<span class="card__price-value">$2,199</span> | ||
</div> | ||
|
||
<div | ||
class="card__link" | ||
data-qa="hover" | ||
> | ||
<a | ||
href="#" | ||
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 href attribute of the anchor tag is set to '#'. This is generally used as a placeholder and should be replaced with a valid URL or removed if not needed. |
||
class="card__link-button" | ||
> | ||
Buy | ||
</a> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,130 @@ | ||
html { | ||
font-family: Roboto, sans-serif; | ||
} | ||
|
||
body { | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.card { | ||
width: 166px; | ||
border-radius: 5px; | ||
border: 1px solid #f3f3f3; | ||
padding: 32px 16px 16px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
text-align: center; | ||
|
||
&__img { | ||
display: flex; | ||
flex-direction: column; | ||
width: 160px; | ||
height: 134px; | ||
margin-bottom: 40px; | ||
} | ||
|
||
&__text { | ||
line-height: 18px; | ||
font-size: 12px; | ||
font-weight: 500; | ||
color: #060b35; | ||
width: 100%; | ||
height: 36px; | ||
margin-bottom: 0; | ||
} | ||
|
||
&__code { | ||
line-height: 14px; | ||
font-size: 10px; | ||
font-weight: 400; | ||
color: #616070; | ||
width: 100%; | ||
height: 14px; | ||
text-align: left; | ||
margin-bottom: 24px; | ||
} | ||
|
||
&__price { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
width: 166px; | ||
margin-bottom: 16px; | ||
|
||
&-text { | ||
display: flex; | ||
line-height: 18px; | ||
font-size: 12px; | ||
font-weight: 400; | ||
color: #616070; | ||
} | ||
|
||
&-value { | ||
display: flex; | ||
line-height: 18px; | ||
font-size: 16px; | ||
font-weight: 700; | ||
color: #060b35; | ||
} | ||
} | ||
|
||
&__link { | ||
width: 166px; | ||
|
||
&-button { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
text-transform: uppercase; | ||
text-decoration: none; | ||
width: 166px; | ||
height: 40px; | ||
font-weight: 700; | ||
border-radius: 5px; | ||
background-color: #00acdc; | ||
color: #fff; | ||
} | ||
|
||
&-button:hover { | ||
border: 1px solid #00acdc; | ||
background-color: #fff; | ||
color: #00acdc; | ||
} | ||
} | ||
} | ||
|
||
.stars { | ||
display: flex; | ||
align-items: center; | ||
width: 166px; | ||
margin-bottom: 24px; | ||
|
||
&__star { | ||
background-image: url(/src/images/star.svg); | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
margin-right: 4px; | ||
width: 16px; | ||
height: 16px; | ||
border-radius: 0.5px; | ||
} | ||
|
||
&__star:nth-child(-n + 4) { | ||
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 selector |
||
background-image: url(/src/images/star-active.svg); | ||
} | ||
|
||
&__reviews { | ||
display: flex; | ||
text-align: center; | ||
justify-content: right; | ||
line-height: 14px; | ||
font-size: 10px; | ||
font-weight: 400; | ||
color: #060b35; | ||
} | ||
} | ||
|
||
/*# sourceMappingURL=index.css.map */ |
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.
The href attribute is pointing to a SCSS file. Typically, browsers cannot directly interpret SCSS files. You should link to a compiled CSS file instead.