Button with different format with CSS [duplicate]

2

I needed to make a button with css plus it has a different format.

It is possible to make a button like this only with css

    
asked by anonymous 17.04.2018 / 17:50

2 answers

3

Kirito I suggest you do with linear-gradient, so the corner becomes transparent and even the background sits a picture you can see without problems.

body {
    background-image: url(http://unsplash.it/300/300);
    background-size: cover;
    background-repeat: no-repeat;
}
.canto {
    background-image: linear-gradient(45deg, black 0%, black 90%, transparent 90%);
    width: 200px;
    height: 80px;
    line-height: 80px;
    text-align: center;
    color: peachpuff;
    font-size: 2rem;
    font-family: sans-serif;
}
<div class="canto">Meu BTN</div>
    
17.04.2018 / 18:25
1

Yes, it is possible. You can do this:

div {
    height: 50px;
    background: #0099d9;
    position: relative;
    width:300px;
}

div:before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    border-top: 20px solid white;
    border-left: 20px solid #0099d9;
    width: 0;
}
    
17.04.2018 / 18:25