You can set a css style using several methods:
p = PyQuery('<p></p>')
p.css('font-size','16px')
p.css(['font-size'] = '16px'
p.css = {'font-size':'16px'}
Great, but how to get an individual css style?
p.css('font-size') # jquery-like method doesn't work
[<p>]
p.css['font-size'] # pythonic method doesn't work!
[<p>]
p.css.font_size # BeardedO's suggestion.
[<p>]
p.attr('style') # too much information.
'font-size: 16px; font-weight: bold'
This seems strange, inconvenient and unpyquery and unpython like! One of the first two ought to return the style text, surely?
Is there a way to get a single css style alone without resorting to tools like split()?
p.css.font_size
Does this work?