mercredi 10 août 2016

Creating a gradient border for non-div element

i have button with borders and i wanna to get gradient color in these borders like this (This is gradient in div):

.xx {
  margin: 50px auto;
  width: 250px;
  height: 250px;
  border-top: 20px solid #1AD6FD;
  border-bottom: 20px solid #1D62F0;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  background-position: 0 0, 100% 0;
  background-repeat: no-repeat;
  -webkit-background-size: 20px 100%;
  -moz-background-size: 20px 100%;
  background-size: 20px 100%;
  background-image: -webkit-linear-gradient(top, #1AD6FD 0%, #1D62F0 100%), -webkit-linear-gradient(top, #1AD6FD 0%, #1D62F0 100%);
  background-image: -moz-linear-gradient(top, #1AD6FD 0%, #1D62F0 100%), -moz-linear-gradient(top, #1AD6FD 0%, #1D62F0 100%);
  background-image: -o-linear-gradient(top, #1AD6FD 0%, #1D62F0 100%), -o-linear-gradient(top, #1AD6FD 0%, #1D62F0 100%);
  background-image: linear-gradient(to bottom, #1AD6FD 0%, #1D62F0 100%), linear-gradient(to bottom, #1AD6FD 0%, #1D62F0 100%);
}
<div class="xx"></div>

But, what if i need to get this gradient on ? How to do that? Thanks.

Aucun commentaire:

Enregistrer un commentaire