how to add svg in background as URL in HTML/CSS

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024
  • This video is all about adding svg in background as URL.
    #html #htmlcss #css
    Css:
    .card{
    border: 1px solid black;
    height:200px;
    width:200px;
    background-image: url("data:image/svg+xml,%3Csvg%20fill%3D%22%2300ff00%22%20height%3D%22800px%22%20width%3D%22800px%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20%0A%09%20viewBox%3D%220%200%20330%20330%22%20xml%3Aspace%3D%22preserve%22%3E%0A%3Cpath%20id%3D%22XMLID_225_%22%20d%3D%22M325.607%2C79.393c-5.857-5.857-15.355-5.858-21.213%2C0.001l-139.39%2C139.393L25.607%2C79.393%0A%09c-5.857-5.857-15.355-5.858-21.213%2C0.001c-5.858%2C5.858-5.858%2C15.355%2C0%2C21.213l150.004%2C150c2.813%2C2.813%2C6.628%2C4.393%2C10.606%2C4.393%0A%09s7.794-1.581%2C10.606-4.394l149.996-150C331.465%2C94.749%2C331.465%2C85.251%2C325.607%2C79.393z%22%2F%3E%0A%3C%2Fsvg%3E");
    background-position:center;
    background-repeat: no-repeat;
    background-size: cover;
    }

ความคิดเห็น • 3