What you want to do is to add a class attribute to your django widget using
attrs so that they will be rendered with this class, then to add the style
you want to this class in your CSS section,
This doc shows how to do it:
https://docs.djangoproject.com/en/1.8/ref/forms/widgets/
You can of course override the style as well, for example using the
rendered id of your field, but it is less cleaner, since you will need to
repeat this for every field
On Thursday, May 21, 2015 at 1:00:50 AM UTC+2, dk wrote:
>
> I did a form class and renders fine in the html.
> but look ugly, I do have another field directly done directly in the HTML
> with a style like this and look pretty how can I put it to the form?
> can I override the "style"? or can I change the class? so I can change the
> look? thanks guys.
>
> .text_line {
> -moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
> -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
> box-shadow:inset 0px 1px 0px 0px #ffffff;
> background-color:#ededed;
> -moz-border-radius:6px;
> -webkit-border-radius:6px;
> border-radius:6px;
> border:1px solid #dcdcdc;
> display:inline-block;
> cursor:pointer;
> color:#777777;
> font-family:arial;
> font-size:20px;
> font-weight:bold;
> padding:6px 24px;
> text-decoration:none;
> text-shadow:0px 1px 0px #ffffff;
> }
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/7328fff3-7385-4740-937e-d5d58695045c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.