2016-08-03 3 views
1

나는 wtforms와 플라스크를 처음 사용하고 있으며 실제 필드 크기와 그 내부의 글꼴을 확대하려고합니다. 특정 코드를 사용하거나 CSS로 변경해야합니까? Wtforms 양식 필드 텍스트 확대

This is what it currently looks like. I want the field to be bigger and the font when typed out to be bigger too.

<div class="container"> 
<div class="col-md-12"> 

    <form id="signinform" class="form form-horizontal" method="post" role="form" style="font-size:24px;"> 
    {{ form.hidden_tag() }} 
    {{ wtf.form_errors(form, hiddens="only") }} 
    {{ wtf.form_field(form.first_name, autofocus=true) }} 
    {{ wtf.form_field(form.last_name) }} 
    {{ wtf.form_field(form.company) }} 
    {{ wtf.form_field(form.reason) }} 
    {{ wtf.form_field(form.us_citizen) }} 
    {{ form.signature }} 
    </form> 

은 사전에 감사하고,이 경우 죄송 이미 다른 곳에서 대답했다.

+0

문제가 해결

from wtforms import TextAreaField from wtforms.widgets import TextArea class NameForm(Form): first_name = TextAreaField('First Name', widget=TextArea()) 

은 확대 할 필드에 ID를 추가 하시겠습니까? 그렇다면 대답을 받아주세요 :) –

답변

2

TextAreaField을 사용하여 크기를 정의 할 수 있습니다.

{{ form.first_name.label(id='middle') }} 
{{ form.first_name(cols="20", rows="1", id='larger') }} 

다음 CSS에 글꼴 크기를 정의 :

#larger { 
font-size: 60px; 
} 

#middle { 
font-size: 40px; 
} 
+0

고마워요! 이것은 정말로, 정말로 나를 도왔다. – BrettJ

관련 문제