Нужно сделать такую стрелку на css.высота стрелки 10px.
2 ответа
Используйте 2 бордера и transform:rotate(45deg);
.arrow {
width: 30px;
height: 30px;
background-color: #f61;
}
.arrow:after {
content: '';
display: block;
border-right: solid #fffa;
border-top: solid #fffa;
width: 7px; /* sqrt(7*7 + 7*7) */
height: 7px; /* это примерно 10 */
transform: translate(8px, 10px) rotate(45deg);
}
<div class="arrow"></div>
-
-
он у меня в другом блоке и я хочу ему сделать падинг справа но стрелка деформируется– btcfakir28 июл 2019 в 7:11
-
Добавьте новый код:
css >
img {
width: 10px;
height: 10px;
}
html>
<img src="..." style="width: 10px; height: 10px;" alt="...">
<img src="..." width="10" height="10" alt="...">
::before
,::after
иborder
и будет вам счастье.