Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Change CSS file in base template depending on browser [RSS Feed]

#1 Jan. 18, 2011 15:01:28

m.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Change CSS file in base template depending on browser


Hi there,

I have 2 css files. One specifically for IE because it's so horrible.
I'd like to load either or css files depending on the browser.

I know I have to use
agent = request.META

I looked at thishttp://djangosnippets.org/snippets/77/but it seems
complex.

All I want is something like this.
{% if request.META == 'IE' %}
<link href="{{ MEDIA_URL }}css/ie.css" rel="stylesheet"
type="text/css" media="all">
{% else %}
<link href="{{ MEDIA_URL }}css/site.css" rel="stylesheet"
type="text/css" media="all">
{% endif %}

Can I have some advice or point me to a place which shows what to do.
Thanks a lot.

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » Change CSS file in base template depending on browser [RSS Feed]

Board footer

Moderator control

Enjoy the 19th of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support