2016-07-21 8 views
1

Hallo Ich möchte fragen, wie Sie den Textbereich im Formular mit CSS überschreiben. Dies ist mein Codes:Python: Wie überschreiben Textbereich in Formular mit Hilfe von CSS

forms.py

description = forms.CharField(widget=forms.Textarea(attrs={'class': 'comment-control'})) 

CSS:

.comment-control { 
    background-color: #fff; 
    width: 830px; 
    height: 110px; 
} 

HTML

<form name="add_comment" id="comment-form" action="{% url 'comment:create' refId=refApp.id refApp=thisApp %}" method="post"> 
    {% csrf_token %} 
{{ form }} 
    </form> 

ich das Layout des Textbereiches des Formulars mit CSS ändern möge aber es wird nicht vererbt, ich schätze deine Hilfe. Danke

Antwort

1

sollten Sie etwas tun:

description = forms.CharField(widget=forms.Textarea(attrs={'cols':'4', 'rows':'50'})) 
+0

Dank! Das hat sehr geholfen! –

+0

sehr willkommen –

Verwandte Themen