S
S
Sergey Zolotarev2021-03-16 13:16:17
css
Sergey Zolotarev, 2021-03-16 13:16:17

How to add an inscription to a colored background?

Good afternoon!
At the moment I am solving a problem in which I need to add labels to the backgrounds of the blocks in accordance with this layout . In my made up version of the page for blocks, only background colors are set, but inside the background (not inside the block) I'm trying to implement the very inscriptions from the layout.
But what features does CSS3 offer in this regard?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
v3shin, 2021-03-16
@seregazolotaryow64

It is possible like this:

#news:before {
    content: 'NEWS';
    position: absolute;
    top: 0;
    left: 0;
    font-size: 200px;
    opacity: .2;
}
#news header,
#news main {
    position: relative;
    z-index: 1;
}

Well, customize the styles for yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question