javascript - 使用 jquery 格式化和验证 CSS

标签 javascript jquery html css

是否有一个 jquery 插件来验证 CSS?

我的意思是,我想让用户在文本框中输入自己的 CSS 并使用 jquery 验证是否是有效的 CSS?

例子:

@font-face {
    font-family: 'NationalRegular';
    src: url('http://localced.com/national-regular-webfont.eot');
    src: local('National'), local('NationalRegular'), url('http://localced.com/national-regular-webfont.woff') format('woff'), url('http://localced.com/national-regular-webfont.ttf') format('truetype'), url('http://localced.com/national-regular-webfont.svg#webfontHGfqMJAZ') format('svg');
    font-weight: normal;
    font-style: normal;
***notgoodCSS***:this is not good;
}

最佳答案

在您自己的服务器上使用 W3C 验证器。

执行命令行并将结果返回给 jquery(通过 Ajax 调用)。

http://jigsaw.w3.org/css-validator/DOWNLOAD.html

关于javascript - 使用 jquery 格式化和验证 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4433902/

相关文章:

javascript - Bootstrap 数据切换选项卡激活 bootply 库

javascript - 向所有 td 类添加一个额外的类名

javascript - 向客户提供少量数据的最快方式

javascript - JQuery 验证 - 替代方案

javascript - 添加 ngAnimate 时 ngRepeat 行为疯狂

javascript - 使用查询检查 iframe 中的 css

python - 如何导出和保存链接的 Jupyter 笔记本?

javascript - 获取要在 html 链接中使用的 DataTables 单元格值

jquery - BXslider 并在 onAfterSlide 回调上调用事件 LI

javascript - 如果鼠标在元素上快速移动,则防止 .hover 事件被垃圾邮件发送