N
N
nagge1012018-01-24 20:53:42
css
nagge101, 2018-01-24 20:53:42

:after Not displayed, why?

#blcus {
    background-attachment: fixed;
    background-image: url(../images/b-h.jpg);
    background-size: cover;
    margin: 10px 30px 0px 30px;
    padding-bottom: 20px;
    position: relative;
    z-index: 1;
}
#blcus:after {
    background-color: #272a33f2;
    content: '';
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 2;
}

Hello. I'm doing a project and I have a problem with displaying :after...
Change has a section block, it has a background-image image and :after on top, which adds a dark color on top. Everything is written as it should, it is displayed for me personally, but the problem is that it is not displayed for other people and on phones, this after is, as it were, but the color value is not applied, what should I do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
remeder, 2018-01-24
@remeder

In the 'background-color' property, shorten the value to 6 characters after '#', and at the same time add a second colon before 'after'

A
Alexander Alekseev, 2018-01-25
@shure348

:after literally means after content
if there is no content in the block (empty) then after will not work
, so it does not work for images, inputs, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question