C
C
campus12017-07-29 10:14:33
css
campus1, 2017-07-29 10:14:33

How to inherit an element?

Hello!
How to properly inherit h1?

.about {
    padding: 70px 0 130px 0;
    h1 {
        font: 700 45px/50px $acrom_bold;
        position: relative;
        margin-bottom: 30px;
        text-transform: uppercase;
        color: $light_grey;
        span {
            position: absolute;
            top: -20px;
            left: -35px;
            display: block;
            width: 16px;
            height: 16px;
            background-color: $blue;
            &::before {
                content: "";
                position: absolute;
                top: 20px;
                left: -10px;
                display: block;
                width: 12px;
                height: 12px;
                background-color: $green;
            }
            &::after {
                content: "";
                position: absolute;
                top: 22px;
                left: 10px;
                display: block;
                width: 8px;
                height: 8px;
                background-color: $green;
            }
        }
    }
}

I need another h1 element that inherits the css of this element (which is higher in the code)!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
iBird Rose, 2017-07-29
@campus1

well, you pull out h1 styles from .about

S
Sergey, 2017-07-29
@Shull

Please clarify, are you using SASS?
Look at the code in other SASS files, maybe it overrides the current properties.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question