Yes, you can.
In your form.py
you can add all css attribute using widget
.
class OrganizationForm(forms.Form):
class Meta:
model = Organization
fields = ('org_about', 'org_pic')
org_about = forms.CharField(
label='About Organization',
required=False,
widget = forms.Textarea(
attrs={
'class': 'form-control valid',
'onfocus': 'this.placeholder = ''',
'onblur': "this.placeholder = 'About Your organization'",
'type':'text',
'placeholder': 'About Your organization',
'rows': 5,
'cols': 15,
'value': 'about organization',
}
)
)
See more details here about widgets
.
There is no way exactly what you want as far as i know. I am sharing an idea you can implement such way:
input {
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="30"><text x="5" y="19" style="font: bold 16px Arial;">Age:</text></svg>') no-repeat;
border: 1px solid #555;
box-sizing: border-box;
font: 16px "Arial";
height: 30px;
padding-left: 50px;
width: 300px;
}
<input type="text" />
more details
Besides, you can use
:before :after
css
effect to implement what you want.