Python: How to override text area in form using CSS


Tags: python,html,css

Problem :

Hi I would like to ask on how to override the text area in form using CSS. This is my codes:

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>

I want to change the layout of the textarea of form using CSS but it is not being inherited, I appreciate your help. Thank you



Solution :

you should do something like this:

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

    CSS Howto..

    How to create dynamic CSS class in in extjs or javascript

    PHP/CSS how to keep my checkboxs from going past my border

    Javascript - How to alter a property of a css class

    Vertical centering images within a slideshow using JS code?

    How do I replicate the bootstrap mobile navbar toggle (without using bootstrap)?

    How to insert FontAwesome inside Select2

    How to create new line with css or javascript?

    Do I need to use float:clear to have content show where I want it to show?

    How to adapt a flex div's width to content

    How to overlap other elements using resizable element?

    How to prevent links from wrapping in CSS megamenu div (inheritance issue)

    How to overlap a border in CSS in order to create tabs?

    Css, text shadow - How to get it overflow off the div

    How can i find and change css style in ruby?

    How to incrementally increase the value of a css property every click?

    How to Implement this UI with CSS [closed]

    How to inherit photo when hover on links under navigation bar?

    How to properly use CSS borders to visualize a value chain?

    How to remove “left” value bootstrap popover

    How to link a css file with the Slim templating engine?

    How can I translate with webkit-transform enough so that

    How to center text horizontally and vertically within box element? [duplicate]

    JavaFX: How do I set a Background Image in code?

    How to make children auto fit parent's width only with CSS?

    CSS: How to change the color of the bottom right square of the scrollbar in webkit?

    How to use ASP.NET Authorization Yet Permit Access to .css Files?

    How to use Bootstrap CDN?

    How to change the background color of a div in HTML/CSS

    How to fetch the background of DIV on a bottom layer with exact position using jQuery and CSS

    How do I center a button in html5?