Add a CSS class to an option in a WTForms SelectField
问题 Can anyone please tell me how to assign css class to choices values. I would like to change the background of each choices with small image, so how can I do it with wtforms and css? class RegisterForm(Form): username = TextField('username', [validators.Length(min=3, max=50), validators.Required()]) img_url = SelectField('avatar', choices=[('static/images/avatars/1.jpg', '1'), ('static/images/avatars/2.jpg', '2'), ('static/images/avatars/3.jpg', '3'), ('static/images/avatars/4.jpg', '4'), (