I have a little problem. I am implementing a website design and need to implement a slightly sophisticated button style (attached here). I do not know how to do this using only CSS.

This will be several styles of buttons, and one of them should be with a transparent background and should get the background color from the element where this button is located. I have implemented a button with a custom background that can be set using CSS. But it is not flexible to use. If I want to use it on different backgrounds, you should add a new style, for example "btn-customColor", etc. Now I have styles for the transparent background, and it looks:

, . , . . btn-transparent btn-blue, btn-green, btn-white ..
, , "". , -. ? , , ..
, : HTML, CSS, JS (jQuery).
, , .
.
.
.btn-base {
padding: 0;
margin: 0;
height: 30px;
outline: none;
border-radius: 3px;
background: transparent;
border: 2px solid #fff;
font-size: 12px;
transition: 0.5s;
}
.btn-base>div {
position: relative;
width: 101%;
left: 3px;
bottom: 8px;
padding: 5px 15px;
outline: none;
border-radius: 3px;
background: #e4645d;
border: 2px solid #fff;
font-size: 12px;
}
<button type="submit" class="btn-base btn-transparent">
<div>Button example</div>
</button>
Hide result