Как добавить точку для псевдоэлемнта?
В стилях есть псевдоэлемент .decorated-zone::before с текстом "REC" . По макету нужно добавить еще точку со стилями .
Стили для точки такие:
fill: #FF0070;
filter: drop-shadow(0px 0px 4px #FF0070);
Вопрос: как в псевдоэлемент добавить такую точку ?
.page {
font-family: IBM Plex Mono;
font-size: 18px;
background-image: url("https://s1.hostingkartinok.com/uploads/images/2023/11/8e263f969c2107e4630ae3a539834a22.png");
background-position: top center;
background-size: cover;
background-attachment: fixed;
}
/*header*/
.header {
display: grid;
grid-template-rows: 1fr 1fr 1fr;
align-items: center;
justify-content: center;
padding: 20px;
}
.decorated-zone::before {
content: 'REC';
color: var(--accent-color);
position: absolute;
top: 0;
right: 0;
height: 33px;
}
.header__theme-menu {
justify-self: end;
}
.header__theme-menu-list {
display: flex;
flex-direction: column;
gap: 10px;
}
.header__theme-menu-button {
border: 1px solid transparent;
color: var(--accent-color);
font-family: inherit;
font-weight: 400;
font-size: 18px;
line-height: 18px;
text-align: center;
text-transform: lowercase;
background-color: transparent;
padding: 0px, 13px;
}
.header__theme-menu-button_active {
pointer-events: none;
border: 1px solid var(--accent-color);
}
.title {
color: var(--title-color);
font-weight: 700;
font-size: 116px;
line-height: 82.5%;
text-shadow: 4px 4px 0px var(--accent-color);
padding-top: 15px;
}
.title_description {
justify-self: end;
width: 100%;
min-width: 355px;
/* максимальная ширина блока */
font-family: inherit;
font-weight: 700;
background-color: var(--accent-color);
}
/*Адаптив для планшетов*/
@media (min-width: 768px) and (max-width:1023.99px) {
.header {
gap: 162px;
justify-content: normal;
}
.title {
font-size: 120px;
}
.title_description {
width: 100%;
max-width: 491px;
}
}
/*Адаптив для десктоп*/
@media (min-width: 1024px) {
.header {
gap: 162px;
justify-content: normal;
align-items: start
}
.header__theme-menu {
justify-self: center;
}
.header__theme-menu-list {
flex-direction: row;
}
.title {
font-size: 157px;
}
.title_description {
max-width: 50%;
}
}
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Сложно сосредоточиться</title>
<link rel="stylesheet" href="style.css" />
</head>
<body class="page">
<header class="header decorated-zone">
<nav class="header__theme-menu">
<ul class="header__theme-menu-list">
<li class="header__theme-menu-item">
<button class="header__theme-menu-button header__theme-menu-button_type_light">
День
</button>
</li>
<li class="header__theme-menu-item">
<button class="header__theme-menu-button header__theme-menu-button_active header__theme-menu-button_type_auto" disabled>
Авто
</button>
</li>
<li class="header__theme-menu-item">
<button class="header__theme-menu-button header__theme-menu-button_type_dark">
Неон
</button>
</li>
</ul>
</nav>
<h1 class="title">no focus</h1>
<p class="title_description"> Что делать, когда не можешь делать ничего<br/> Или почему нам так сложно сконцентрироваться, особенно когда очень надо</p>
</header>
<script src="./scripts/script.js"></script>
</body>
</html>
Ответы (2 шт):
Автор решения: Grundy
→ Ссылка
Можно установить backgound-image с нужным рисунком svg, затем позиционировать его как требуется с нужным размером, например:
.decorated-zone::before {
content: 'REC';
color: black;
position: absolute;
top: 50%;
left: 50%;
background-image: url('data:image/svg+xml,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle fill="%23FF0070" filter="drop-shadow(0px 0px 4px %23FF0070)" cx="50" cy="50" r="42" /></svg>');
padding-right: 22px;
background-position: center right;
background-size: 18px;
background-repeat: no-repeat;
}
<header class="header decorated-zone">
</header>
Автор решения: puffleeck
→ Ссылка
#x:before{
margin-left: 5em;
content: 'REC';
display: inline-block;
width: 1.5em;
height: 1.5em;
border-radius: 100%;
background: lime;
box-shadow: 3em 0 3px pink; /*!!!*/
}
<span id='x'>_______________</span>
на первый взгляд как то так... можно пожалуй и уголок захватить сюда же, если точку радиал градиентом рисовать а не тенью... ну думаю намек понятен
