A
A
Arthur Levenson2021-06-09 10:36:27
css
Arthur Levenson, 2021-06-09 10:36:27

How to implement decorative elements with after and before?

Tell me how to make this
60c06f6a1f02d602629240.png

code https://codepen.io/kiskiskit/pen/JjWBvNz

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Markov, 2021-06-09
@kiskiskit

<div class="wrapper">
            <h1 class="title">Заголовок</h1>
        </div>

.wrapper {
            position: relative;
            z-index: 0;
            display: flex;
            justify-content: center;
        }

        .wrapper:after {
            content: '';
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            height: 1px;
            width: 100%;
            background-color: red;
            z-index: -1;
            margin: auto;
        }

        .title {
            background-color: #fff;
            padding: 0 10px;
        }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question