浏览器——》在浏览器上编写文字

版权声明:本文为博主原创文章,无需授权即可转载,甚至无需保留以上版权声明,转载时请务必注明作者。
https://blog.csdn.net/weixin_43453386/article/details/88422442

浏览器——》在浏览器上编写文字

1、默认的文字样式

打开浏览器,在浏览器的地址栏直接输入data:text/html, <html contenteditable>
在这里插入图片描述

2、有格式的文字样式

打开浏览器,在浏览器的地址栏直接输入data:text/html, <html><head><link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'><style type="text/css"> html { font-family: "Open Sans" } * { -webkit-transition: all linear 1s; }</style><script>window.function(){var e=false;var t=0;setInterval(function(){if(!e){t=Math.round(Math.max(0,t-Math.max(t/3,1)))}var n=(255-t*2).toString(16);document.body.style.backgroundColor="#ff"+n+""+n},1e3);var n=null;document.onkeydown=function(){t=Math.min(128,t+2);e=true;clearTimeout(n);n=setTimeout(function(){e=false},1500)}}</script></head><body contenteditable style="font-size:2rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;">
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43453386/article/details/88422442