def _parse_style_attribute(inline_styles):
    """Parse the style attribute value into a dict of css declarations."""
    inline_css = {}
    inline_styles = inline_styles.split(';')
    for rule in inline_styles:
        rule = rule.split(':')
        if len(rule) != 2:
            continue
        name, value = rule
        name = name.strip()
        value = value.strip()
        if name and value:
            inline_css[name] = value
    return inline_css
