English 中文(简体)
django和tw锁在IE8没有正确操作
原标题:django and twitter bootstrap does not work correctly in IE8

我试图在django模板中使用tw锁的航道。 我将以下内容放在“基地.html”的前面。

<link href="{{ STATIC_URL }}bootstrap/css/bootstrap.css" rel="stylesheet">

该网页在hr。 但是,当我改头换第8号独立调查时,特别安全局就显得重要了。 “集装箱”不再以为中心,航道也不正确。

接着,我试图把干.带走。 我将boot锁.带移到地下室的夹点。

<link href="bootstrap.css" rel="stylesheet">

Then I open the base.html in IE directly, and everything looks correct again. So it seems in IE8, the django template rendering is messing up with the bootstrap s css somehow. Any idea? Thanks.

= ==复制 fro IE8“view-source” ================================================================================================================================================================================================================================================================

a. 采用django模板,使:

<!DOCTYPE html>
<html lang="zh-CN" autopagermatchedrules="1">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>AAA</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
        <link href="/static/bootstrap/css/bootstrap.css" rel="stylesheet">
        <style>
            body {
              padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
            }
        </style>
    </head>

    <body>
        <div class="navbar navbar-fixed-top">
          <div class="navbar-inner">
            <div class="container">

              <a class="brand" href="/">AAA</a>
              <ul class="nav">
                <li>
                  <a href="/">
                    BBB
                  </a>
                </li>
                <li>
                  <a href="/">
                    CCC
                  </a>
                </li>
              </ul>

            </div>
          </div>
        </div>
    </body>
</html>

a. 不使用“django”模板:

<!DOCTYPE html>
<html lang="zh-CN" autopagermatchedrules="1">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>{% block title %}{% endblock %}</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
        <link href="bootstrap.css" rel="stylesheet">
        <style>
            body {
              padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
            }
        </style>
    </head>

    <body>
        <div class="navbar navbar-fixed-top">
          <div class="navbar-inner">
            <div class="container">

              <a class="brand" href="/">AAA</a>
              <ul class="nav">
                <li>
                  <a href="/">
                    BBB
                  </a>
                </li>
                <li>
                  <a href="/">
                    CCC
                  </a>
                </li>
              </ul>

            </div>
          </div>
        </div>
    </body>
</html>

===================================== I just found that if I put the following code into "base.html" and extend it in "main.html", IE8 does not work well. But if I move them to "main.html", and does not use django "extend", it is OK.

<!DOCTYPE html>
<html lang="zh-CN" autopagermatchedrules="1">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>{% block title %}{% endblock %}</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
        <!-- Le styles -->
        <link href="{{ STATIC_URL }}bootstrap/css/bootstrap.css" rel="stylesheet">
        <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
          <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        {% block head %}
        {% endblock %}
        <style>
            body {
              padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
            }
        </style>
    </head>


    <body>
        {% block body %}
        {% endblock %}
    </body>
</html>
问题回答

你们是否利用“进口”来补充你的风格。

IE8似乎与“进口-property”一样。

我们使用一个全球文件,输入必要的风格。 在把所有风格都传给头盔,并将之纳入正常的链接标本时,它就发挥了作用。

但是,经常的boot锁(布顿、背景和这种)的杂草进口得当。 电力网系统没有。 我猜测因特网探索者以神秘和有缺陷的方式开展工作。





相关问题
How to get two random records with Django

How do I get two distinct random records using Django? I ve seen questions about how to get one but I need to get two random records and they must differ.

Moving (very old) Zope/Plone Site to Django

I am ask to move data from a (now offline) site driven by Plone to a new Django site. These are the version informations I have: Zope Version (unreleased version, python 2.1.3 ) Python Version 2.1....

Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

Flexible pagination in Django

I d like to implement pagination such that I can allow the user to choose the number of records per page such as 10, 25, 50 etc. How should I go about this? Is there an app I can add onto my project ...

is it convenient to urlencode all next parameters? - django

While writing code, it is pretty common to request a page with an appended "next" query string argument. For instance, in the following template code next points back to the page the user is on: &...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

热门标签