'Returns a string of HTML element attributes.
Use "css" for the CSS classname (since "class" is a reserved word).'

def _attrs(self, **kwargs):

    a = []
    if ('id' in kwargs):
        a.append(('id="%s"' % kwargs.pop('id')))
    if ('name' in kwargs):
        a.append(('name="%s"' % kwargs.pop('name')))
    if ('css' in kwargs):
        a.append(('class="%s"' % kwargs.pop('css')))
    for (k, v) in kwargs.items():
        a.append(('%s="%s"' % (k, v)))
    return ('    ' + '    '.join(a)).rstrip()
