0

我想更改 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;'

你对如何做到这一点有任何想法吗?提前致谢!

4

0 回答 0