style links in javascript console

纵然是瞬间 提交于 2019-12-07 03:15:06

问题


i have a console.log message on my site with a link. The styling is working but the link remains in black font on white background. Can i change that?

$(function() {
  var t = navigator.userAgent.toLowerCase();
  if (/(chrome|firefox|safari)/.test(t.toLowerCase())) {
    var e = ["padding: 20px 5px 16px", "background-color: #171718", "color: #f2641c"].join(";");
    var i = ["padding: 20px 5px 16px", "background-color: #f2641c", "color: #ffffff"].join(";"),
        n = ["background-color: transparent"].join(";");
    console.log("\n\n %c Some text %c http://google.com/ %c \n\n\n", e, i, n);
  } else {
    window.console && console.log("Some text - http://google.com/");
  }
});

来源:https://stackoverflow.com/questions/49728760/style-links-in-javascript-console

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!