Селекторы, часть 2 / Испытание: псевдоэлементы [19/20].Старался максимально оптимизировать.Жду замечаний от профи:)


#1

html,
body {
margin: 0;
padding: 0;
font-family: “Arial”, sans-serif;
line-height: 30px;
}

body {
min-width: 550px;
min-height: 290px;
padding: 10px;
}

.two-cards {
width: 350px;
height: 250px;
padding: 10px;
text-align: center;
}

.two-cards div {
position: relative;
display: inline-block;
width: 120px;
height: 180px;
margin: 0 10px;
margin-top: 30px;
vertical-align: middle;
background-color: white;
border-radius: 5px;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Ширина иконок, не изменяйте */
.two-cards div::before,
.two-cards div::after {
width: 20px;
}
.ace-heart::before,.ace-heart::after,.two-spade::before,.two-spade::after{
position:absolute;
font-weight: bold;
font-size:25px;
padding-bottom:45px;
background-size:25px;
background-repeat:no-repeat;
background-position:50%50%;
}

.ace-heart::before,.ace-heart::after{
content:“A”;
color:red;
}
.two-spade::before,.two-spade::after{
content:“2”;
color:black;
}
.two-spade::after,.ace-heart::after{
right:5px;
bottom:5px;
}
.ace-heart,.two-spade{
background-size:50px;
background-repeat:no-repeat;
background-position:center;
}
.two-spade::before,.ace-heart::before{
left:5px;
top:5px;
}
.ace-heart,.ace-heart::before,.ace-heart::after{{
background-image:url(/assets/course57/heart.svg);
}
.two-spade,.two-spade::before,.two-spade::after{
background-image:url(/assets/course57/spade.svg);

/* Поворот нижней иконки */
.two-cards div::after {
transform: rotate(180deg);
}


#2

Не дооптимизировали. По три раза одну и ту же картинку загружаете.


#3

спасибо)


#4
html,

body {
margin: 0;
padding: 0;
font-family: “Arial”, sans-serif;
line-height: 30px;
}

body {
min-width: 550px;
min-height: 290px;
padding: 10px;
}

.two-cards {
width: 350px;
height: 250px;
padding: 10px;
text-align: center;
}

.two-cards div {
position: relative;
display: inline-block;
width: 120px;
height: 180px;
margin: 0 10px;
margin-top: 30px;
vertical-align: middle;
background-color: white;
border-radius: 5px;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Ширина иконок, не изменяйте */
.two-cards div::before,
.two-cards div::after {
width: 20px;
}

/* Поворот нижней иконки */
.two-cards div::after {
transform: rotate(180deg);
}

.ace-heart::before, .two-spade::before {
position: absolute;
left: 5px;
top: 5px;
font-size: 25px;
font-weight: bold;
height: 50px;
}

.ace-heart::after, .two-spade::after {
position: absolute;
right: 5px;
bottom: 5px;
font-size: 25px;
font-weight: bold;
height: 50px;
}

.ace-heart::before, .ace-heart::after {
content: “A”;
background: url("/assets/course57/heart.svg") no-repeat bottom;
background-size: 25px;
color:red;
}

.two-spade::before, .two-spade::after {
content: “2”;
background: url("/assets/course57/spade.svg") no-repeat bottom;
background-size: 25px;
color:black;
}

.ace-heart {
background: url("/assets/course57/heart.svg") no-repeat 50% 50%;
background-size: 50px;
}

.two-spade {
background: url("/assets/course57/spade.svg") no-repeat 50% 50%;
background-size: 50px;
}

Прошу указать ошибки