在控制台中输入
console.log("%cwww.%cw3cways.%cways","color:red", "font-size:20px", "color:green;font-weight:bold")
最关键的就是用%c
来分隔,%c
后面跟上想要变色的内容,后面也需要跟上对应的样式,有几个%c
就要写几个样式
输出图片也是一样的
console.log("%c ", "background:#3a3a3a url(https://www.w3cways.com/img/wxopen.jpg) no-repeat center;padding-left:250px;padding-bottom: 250px;")
输出图片的时候,%c
后面记得要带个空格,不然输出不了图片了。