Style is also a label (supported in browsers other than IE kernels), and when we set the style to contenteditable, then that content can be edited. Under careful experience, if we change the background to red. So as long as the writing finished, immediately presented. Wow, this is very convenient for us to write that kind of dynamic editor effect later, when there is time, I will try again. Luoning County Kindergarten
Tip: You can change the CSS code in Test_div, such as changing green to blue, #666什么的.
Attach the code of my study:
If you want to know more, you can visit here.
This article uses not the body, but the Div, the relevant code is as follows:
<style type= "Text/css" >.test_div style {display:block;background: #333; color:white;font:14px/1.8 Courier New; Padding:20px;white-space:pre;margin:0 auto;width:250px;height:100px;} </style><div class= "Test_div" ><style contenteditable>.test_div {background:green;} </style></div>
Has fun.
Do a WYSIWYG CSS effect