Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Emoji as CSS Border

Tags:

css

svg

emoji

I am looking for a way to use an emoji as a border for a HTML newsletter. Pretty much, I want the Christmas tree emoji (🎄) to repeat around a div. Any ideas on how to do that?

like image 321
tcam27 Avatar asked Jun 10 '26 09:06

tcam27


1 Answers

Generally, one way would be to use the border-image property, which requires you to use a picture and not a character. As pointed out in the comments, unfortunately this is not well supported in emails.

.christmas {
  display: inline-block;
  padding: 15px;
  border: 33px solid transparent;
  -moz-border-image: url("https://i.sstatic.net/baEaT.png") 33 repeat;
  -webkit-border-image: url("https://i.sstatic.net/baEaT.png") 33 repeat;
  -o-border-image: url("https://i.sstatic.net/baEaT.png") 33 repeat;
  border-image: url("https://i.sstatic.net/baEaT.png") 33 repeat;
}
<div class="christmas">
  Merry Christmas!
</div>

border-image

like image 84
Marvin Avatar answered Jun 12 '26 02:06

Marvin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!