Cheerio: why is .css('font-size') returning undefined?

Created on 16 Jun 2015  路  5Comments  路  Source: cheeriojs/cheerio

.css('font-size') on a jquery object returns undefined.

Is it possible to get the value of .css('font-size') coming form an external css file?

Most helpful comment

A warning in the docs would be appreciated!

All 5 comments

.css is only for the style attribute.

@fb55 is it possible to check the styles applied to an element [via css]?

Cheerio doesn't render pages, so this sadly isn't possible.

This is actually a difference from jQuery's $.css, which gets the value of computed styles. What is your policy around maintaining compatibility with jQuery? Would you consider adding a warning here, if not renaming the method? Glad to make a PR for either.

A warning in the docs would be appreciated!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tndev picture tndev  路  4Comments

trevorfrese picture trevorfrese  路  4Comments

collegepinger picture collegepinger  路  3Comments

rajkumarpb picture rajkumarpb  路  3Comments

M3kH picture M3kH  路  4Comments