css style band output console.log

Basic Usage

console.log("%c text_here","css_style_here");

%cIt represents css styles, which can be accessed immediately following the text. Comma, then the rear css style, wording and *.csssimilar documents, each property semicolon ;separated

You can also write:

console.log("%c text_1","css_1", "text_2");

Output format with css1 style text_1and without css text_2 not wrap style output. Similar to text_1text_2

Rational use can achieve very good results

Supported formats

Format flag console.log supported are:

  • % S placeholder
  • Or an integer of% d% i
  • % F float
  • % O% O object Object
  • % C css styles

console.logOutput can also be shaded large font text, pictures, etc., can be seen more

Guess you like

Origin www.cnblogs.com/peretdressing/p/12301963.html