Home  >  Article  >  Web Front-end  >  style标签进行实时编辑及修改css_html/css_WEB-ITnose

style标签进行实时编辑及修改css_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:35:251238browse

心得:

style也是一个标签,那么也可以使用css对其进行编辑


html5新属性 contenteditable,可以让标签元素处于可编辑状态,对于style标签也适用

为了不影响head标签里的style标签,如此写

body style {}

最后代码为:

body style {            display: block;            padding: 0.6em 0.8em;            border: 1px dashed #ccc;            background-color: #f5f5f5;            color: #000;            font-family: Monaco, monospace;            font-size: 12px;            white-space: pre-wrap;            word-wrap: break-word;        }

<style contenteditable>.test_images{padding: 3px; border: 1px solid #ccc; background-color: #fff;}</style>

感谢张鑫旭大大,转自http://www.zhangxinxu.com/wordpress/?p=1488

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn