不小心按到了 F12 ,看到了这么一个东西
尝试写了一下
代码
console.log("%c ",`font-size:100px;background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBpZD0i5YiX6KGo6aG1IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48ZyBpZD0iZmlsZS1kb2MtMTYtNCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxKSIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNMTEuMzAzLjk4NEgyLjMzYS4yNTQuMjU0IDAgMCAwLS4yNTEuMjA4TC4wMDQgMTIuODAyYS4yNTMuMjUzIDAgMCAwIC4yNTEuMjk2aDQuOTQ2bC4zOTItLjEySDcuODlsLjMyLjEyaDMuODFjLjEyNCAwIC4yMy0uMDg4LjI1Mi0uMjA4bDEuNzA3LTkuNTVMMTEuMzAzLjk4NFoiIGlkPSLot6/lvoQiIGZpbGw9IiMyQTY1RjUiLz48cGF0aCBkPSJtMTEuMzAzLjk4NCAyLjY3NiAyLjM1NmgtMi43OTNhLjI1Mi4yNTIgMCAwIDEtLjI1MS0uMjk1bC4zNjgtMi4wNjFaIiBpZD0i6Lev5b6EIiBmaWxsPSIjMDBEQ0ZGIi8+PGcgaWQ9InByZWZpeF9fYS1saW5rIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIC45ODQpIiBmaWxsPSIjRkZGIj48cG9seWdvbiBpZD0icHJlZml4X19hIiBwb2ludHM9IjYuMjggMC40OTcgMTIuMDU4IDUuNTg3IDExLjkzNSA1LjU5IDguMzggNS41OSA3LjIxIDEyLjExNCA0LjIgMTIuMTE0IDUuMzcgNS41OSAzLjAxIDUuNTkgMC44ODMgMy4zMjEgNS43NzggMy4zMTMiLz48L2c+PC9nPjwvZz48L3N2Zz4=);background-size:contain;background-repeat:no-repeat;`)
%c 后面两个空格,CSS 是给这两个空格写的样式,100px 决定这个背景图的大小,腾讯文档的应该是 40px ,这个值改得越大,这个图越大
实际应用效果:
1
iMusic 2023-12-01 13:44:27 +08:00
😨以前还支持网络图片的
|