Is there a way to create a button (or div) with a border that has a gradient and has rounded corners?
<p>This is what it should look like: </p>

<p><a href="https://i.stack.imgur.com/1lz60.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1lz60.png" alt="enter image description here"></a></p>

<p><strong>Attempts so far:</strong></p>

<ol>
<li>Using a gradient background plus an inner element to cover it and leave just an outer "border". The <strong>background is obviously not transparent</strong>. </li>
</ol>

<p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-css lang-css prettyprint-override"><code>body {
  background: #242424;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: sans-serif;
  color: #FFFFFF;
}

div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
}

h1 {
  margin: 2em;
  text-align: center;
}

a {
  cursor: pointer;
  transition: ease-in-out,.2s,color;
}
a:hover {
  color: #DDD;
}

.nested {
  display: block;
  max-width: 20em;
  padding: 2px;
  overflow: hidden;
  border-radius: 2em;
  background: linear-gradient(to right, #00ff00 0%, #00e5ff 100%);
}
.nested span {
  display: inline-block;
  padding: 1em;
  text-align: center;
  background: #242424;
  border-radius: 2rem;
}
.nested span p {
  padding: 0 2em;
  margin: 0;
}

.pseudo {
  display: block;
  margin-top: 20px;
  position: relative;
  border-radius: 2em;
  padding: 1em 2em;
  background: #242424;
}
.pseudo:after {
  position: absolute;
  z-index: -1;
  top: -2px;
  bottom: -2px;
  right: -2px;
  left: -2px;
  background: linear-gradient(to right, #00ff00 0%, #00e5ff 100%);
  border-radius: 2em;
  content: '';
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
    &lt;h1&gt;Gradient + Border Radius&lt;/h1&gt;
    &lt;a class="nested"&gt;&lt;span&gt;&lt;p&gt;ANOTHER ONE&lt;/p&gt;&lt;/span&gt;&lt;/a&gt;
    &lt;a class="pseudo"&gt;AND ANOTHER ONE&lt;/a&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<ol start="2">
<li>Using <code>border-image</code>. The <strong>corners are not rounded</strong>.</li>
</ol>

<p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-css lang-css prettyprint-override"><code>body {
  background: url(http://subtlepatterns2015.subtlepatterns.netdna-cdn.com/patterns/ignasi_pattern_s.png);
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: sans-serif;
}

a {
  padding: 20px 40px;
  border-image: linear-gradient(to bottom right, #00aeef 0%, #7cc578 100%);
  border-image-slice: 1;
  border-radius: 10px;
}

div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
}

h1 {
  margin: 2em;
  text-align: center;
}

a {
  text-decoration: none;
  font-weight: bold;
  color: black;
  cursor: pointer;
  transition: ease-in-out,.2s,color;
}
a:hover {
  color: #DDD;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
    &lt;h1&gt;Gradient + [non working] Border Radius&lt;/h1&gt;
    &lt;a href="#"&gt;CLICK ME &lt;/a&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>