2014年1月24日

使用JavaScript获取CSS伪元素属性

摘要: 我们可以通过DOM元素的 style 属性获取基本的CSS样式值, 但怎么获取CSS伪元素属性呢? 如下// 获取 .element:before 的 color 值var color = window.getComputedStyle( document.querySelector('.element'), ':before').getPropertyValue('color'); // 获取 .element:before 的 content 值var content = window.getComputedStyle( document.q 阅读全文

posted @ 2014-01-24 11:45 dubaokun 阅读(1753) 评论(0) 推荐(1)

导航

新浪微博 新博客 Github