How to apply in CSS3 edges rounded with gradient

3

Hi, I'm wanting to apply rounded borders with gradients to a box but I can not do it, although the gradient applies the edges, I would like them to be like the example I attached

.box {
  border: 2px solid green;  
  border-image-source: linear-gradient(#a42e6e, #783057);
  border-image-slice: 20;
  padding: 2em;
  -webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
}
  <div class="box">
    <h4 class="titulo-degradado-1">
      174
    </h4>
    <p>Atención al vecino</p>
  </div>
    
asked by MarianoF 05.12.2017 в 16:09
source

2 answers

1

You can see examples Here .

I hope I can help you, Regards.

    
answered by 05.12.2017 в 17:41
1

This way you can handle it with your colors. I have no merit in this answer, I leave you the LINK from where I saw the information.

.box {
    position: relative;
    border: 4px solid transparent;
    border-radius: 16px;
    background: white;
    background-clip: padding-box;
    padding: 10px;
}


.box::after{

    position: absolute;
    top: -4px; bottom: -4px;
    left: -4px; right: -4px;
    background: linear-gradient(#a42e6e, #783057);
    content: '';
    z-index: -1;
    border-radius: 16px;

}
<div class="box">
    <h4 class="titulo-degradado-1">
      174
    </h4>
    <p>Atención al vecino</p>
  </div>
    
answered by 05.12.2017 в 16:18