Skip to content Skip to sidebar Skip to footer

How To Cut Out A Shape From An Html Element

I've been searching for 2 days now, reading up on clip, clip-path, masking and everything there is to know about this css-subject. But I can't figure out how to achieve the follow

Solution 1:

Okay, I think I've found a solution here that suits your needs!

.clip-text {
    font-size: 6em;
    font-weight: bold;
    line-height: 1;
    position: relative;
    display: inline-block;
    margin: .25em;
    padding: .5em .75em;
    text-align: center;
    /* Color fallback */color: #fff;
    -webkit-background-clip: text;

    -webkit-text-fill-color: transparent;
}

.clip-text:before,
.clip-text:after {
    position: absolute;
    content: '';
}


.clip-text:before {
    z-index: -2;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: inherit;
}


.clip-text:after {
    position: absolute;
    z-index: -1;
    top: .125em;
    right: .125em;
    bottom: .125em;
    left: .125em;
    background-color: #000;
}


.clip-text--no-textzone:before {
    background-position: -.65em0;
}

.clip-text--no-textzone:after {
    content: none;
}

.clip-text--cover,
.clip-text--cover:before {
    background-repeat: no-repeat;
    -webkit-background-size: cover;
            background-size: cover;
}

.clip-text_one {
    background-image: url(http://lorempixel.com/480/200/abstract/7);
}
<divclass="clip-text clip-text_one">THIS IS CUT OUT</div>

Post a Comment for "How To Cut Out A Shape From An Html Element"