我想更改FileField的默认“浏览”按钮的大小,字体颜色和字体大小。以下代码无效:
class SubmitForm(forms.Form):
uploadedfile = forms.FileField(required=True, label='File to upload:')
def __init__(self, *args, **kwargs):
super(SubmitForm, self).__init__(*args, **kwargs)
self.fields['uploadedfile'].widget.attrs['style'] = 'width: 280px; size: 100px;'
您对如何做到这一点有什么想法吗?提前谢谢!