<div class="product">
<span class="product__price">$120</span>
<img class="product__image" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/26438/shoe.png">
<h1 class="product__title">Nike Roshe Run Print</h1>
<hr />
<p>The Nike Roshe One Print Men's Shoe offers breathability, lightweight cushioning and bold style with an injected unit midsole and colorful mesh upper. </p>
<a href="#" class="product__btn btn">Buy Now</a>
</div>
$background: #F0F0F0;
$white: #fff;
$black: #000;
$grey: #666;
$accent: #cf092c;
$font-bold: 700;
$time: 0.3s;
$easing: cubic-bezier(0.4, 0, 0.2, 1);
@mixin shadow {
box-shadow: 0 30px 25px -20px rgba($black, 0.15);
}
@mixin shadow-dark {
box-shadow: 0 36px 28px -20px rgba($black, 0.20);
}
%caps {
font-size: 0.8em;
text-transform: uppercase;
letter-spacing: 1.4px;
font-weight: $font-bold;
}
*, *:before, *:after {
box-sizing: border-box;
}
html,
body {
height: 100%;
}
body {
font-family: system, ".SFNSText-Regular", 'Helvetica Neue', sans-serif;
line-height: 1.5;
color: $grey;
display: flex;
align-items: center;
justify-content: center;
background-color: $background;
// -webkit-filter: hue-rotate(-90deg);
}
img {
max-width: 100%;
height: auto;
vertical-align: top;
}
hr {
border: 0;
height: 3px;
width: 30px;
background-color: $accent;
margin: 22px 0 20px;
}
a {
text-decoration: none;
color: inherit;
}
p {
margin: 0 0 1.5em 0;
&:last-child {
margin-bottom: 0;
}
}
.btn {
display: inline-block;
color: $white;
text-align: center;
padding: 1.75em 3.5em;
white-space: nowrap;
border-radius: 5px;
@extend %caps;
}
.product {
position: relative;
width: 400px;
padding: 40px;
border-radius: 8px;
background-color: $white;
transition: box-shadow $time $easing;
@include shadow;
}
.product__image {
width: 180%;
margin-left: -40%;
margin-right: -40%;
margin-top: -5px;
margin-bottom: 30px;
max-width: none;
}
.product__title {
font-size: 30px;
color: $black;
margin: 0 0 0.5em 0;
line-height: 1.1;
}
.product__price {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
top: -30px;
left: -30px;
width: 100px;
height: 100px;
background-color: rgba($black, 0.95);
color: $white;
border-radius: 50%;
@extend %caps;
}
.product__category {
display: block;
color: $accent;
margin-bottom: 1em;
@extend %caps;
}
.product__btn {
position: absolute;
bottom: -30px;
right: 30px;
background-color: rgba($accent, 0.95);
transition: background-color $time $easing, box-shadow $time $easing;
@include shadow;
&:hover {
@include shadow-dark;
background-color: mix($accent, $black, 95%);
}
}
View Compiled
This Pen doesn't use any external CSS resources.