Make a WYSIWYG CSS effect

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.