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

WBOY
Release: 2016-06-24 11:35:25
Original
1283 people have browsed it

心得:

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


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

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

body style {}
Copy after login

最后代码为:

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;        }
Copy after login

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

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template