I think the best thing for you do is to create the css outside the template. Like this - create the css file, separately, then reference the file in the template.
Or, better yet, add the css you need for your form in you main css file that is referenced in your base template and just inherit it by using a tag {{ extends "base.html""}, then you will have a uniform look throughout the site and you won't have to worry about but once. On Fri, Mar 23, 2012 at 3:10 AM, Mario Gudelj <mario.gud...@gmail.com>wrote: > It doesn't matter how you generate your form, your CSS should be applied > from inside the template. You need to add a CSS file link to a template to > which you're passing the form to inside your context from within a view, or > you can embed it into your template using <style> tags. > > > On 23 March 2012 09:46, hack <scottma...@gmail.com> wrote: > >> I think I shot myself in the foot using ModelForms to generate all of my >> html forms. Is there any way to use a stylesheet when your forms are >> generated from ModelForms? >> >> I've tried everything and cannot get it to work. I've tried directly >> importing the css files, I've tried loading them from STATIC, and I've >> tried setting css in Meta, but nothing seems to work. All I have to do is >> add some color to my tables and align the text to the left of the cells. >> Thanks. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/django-users/-/d_3ry3L6DuEJ. >> To post to this group, send email to django-users@googlegroups.com. >> To unsubscribe from this group, send email to >> django-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.