Reputation: 501
How to make rounded dotted border with gradient in CSS3? I found only borders with gradient and dotted borders separately. This is what I have to implement:
Upvotes: 2
Views: 3534
Reputation: 64174
You can set a white dotted border on top of a gradient image covering only the border zone. It looks like your request
.test {
width: 300px;
height: 80px;
margin: 10px;
border: dotted 10px white;
border-radius: 50px;
background-image: linear-gradient(white, white), linear-gradient(blue, magenta);
background-origin: border-box;
background-clip: content-box, border-box;
}
<div class="test"></div>
Upvotes: 4
Reputation: 645
This can be easily done with CSS3 .
<div class="greeting">Hello&Welcome</div>
And the corresponding css :
.greeting{
width:150px;
height:100px;
background-color:cyan;
line-height:100px;
color :white;
text-align:center;
border: 2px dotted black;
border-radius:20px;
}
Please find the code in codepen: https://codepen.io/Debabrata89/pen/VadLMM
Hope this helps.
Upvotes: 1