獲取 CSS 屬性

要獲取元素的 CSS 屬性,可以使用 .css(propertyName) 方法:

var color    = $('#element').css('color');
var fontSize = $('#element').css('font-size');