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N3piG+PeBwdqt4N1boc0x1pragIit0OZgNAKyxgRJiByS5+HwjJGhAmojNGlGSNRj43ouozRBric4nNLgFaXZoEkmjEaNJ8x8puM0YAWIFBaHSq3Cyow6EBphWWMBjUHiMJljEEFBh2FyxgNag4QhcsYgwoMOgqZMRrUHSAKmTEGVRh0FDJjNKg7QBQyYwyqMOgobMZoUHuAKGTGGFRh0FHIjNGg7gDRyBgDSzbeAY/XrKMwX5o1ExqvIaIwBBMWryGisMYnfPppICpea3zCp8+Yxid8agIsXkNEYQimf9vA4jVEFIZgpiagIisEF8FMTUBFVggugpmagIqsEFwEMzXB/yAiKxQXobX29Zp1ZOVN8A3BtWbWTPCCLSMrz8sagmvJrP2LzARbRVYZL1siuFbMwIRMdN7IKuOsXCK4eZlrmuDF54msVhZfv43g5mGua4IXjoqsEFwEs/7kNdbfdwdeA3JGPQQwa5RDAAAAAElFTkSuQmCC");
}
html, body {
width: 100%;
height: 100%;
display: flex;
}
div {
position: relative;
width: 200px;
height: 120px;
margin: auto;
}
.heart {
border: 21px solid;
-o-border-image: var(--url) 21 round;
border-image: var(--url) 21 round;
}
演示效果