下面的代碼將顯示,我想讓兼容使用引導和css使我的HTML網站兼容
{% load staticfiles %}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>*****</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{% static 'bootstrap/css/bootstrap.min.css' %}" rel="stylesheet" media="screen">
<link href="{% static 'bootstrap/css/dashboard.css' %}" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="{% static 'bootstrap/js/bootstrap.min.js' %}"></script>
<link href="{% static 'style_sample.css' %}" rel="stylesheet">
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="{% static 'script_sample.js' %}"></script>
</head>
<body>
{% block content %}
<div id="header>">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" ><img src="{% static "bootstrap/css/logo4.png" %}" alt="" style="margin-top:-5%;"/></a>
</div>
<div>
<ul class="nav navbar-nav navbar-right">
<li></li>
<li><a href="#"><span class="glyphicon glyphicon-user"></span>
{{ user.first_name }}</a></li>
<li><a href="{% url 'django.contrib.auth.views.logout' %}"><span class="glyphicon glyphicon-log-out\" ></span>Logout</a></li>
</ul>
</div>
</div>
</nav>
</div>
<div class="menu_sample top_mar">
<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
<li><span style="color:blue; font-weight:bold;">Dashboards</span></li>
{% for Dashboard in dashboards %}
<li><a href="{{ Dashboard.d_url }}">{{ Dashboard.d_name }}</a></li>
{% endfor %}
</ul>
</div>
</div>
<div class="content pushed top_mar">
<button onclick="toggleMenu()"><span id="menu-button"><span class="glyphicon glyphicon-chevron-left" id="glymphi" style="margin-left:24%;"></span></span></button>
</div>
<div style="margin-left:-1%; margin-top:3.5%; height: 625px;" class="col-sm-9" >
<iframe width="100%" height="95%" name="iframe_a" frameborder="0"></iframe>
</div>
{% endblock %}
</body>
</html>
,CSS我現在用的就是如下
/* Styles go here */
.menu_sample {
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 100px;
border: solid 1px;
transition: transform 0.1s ease-out;
}
.content {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
padding: 10px;
transition: left 1s ease-out;
margin-left: -2%;
margin-top: 150%;
}
/*transition*/
.top_mar {
margin-top: 25%;
}
/* on toggle*/
.content.pushed {
left: 225px;
}
.hide {
transform:translateX(-100px);
}
我可以看到奇怪的事情,當我減少或增加瀏覽器的大小。 需要幫助,使之成爲各種規模兼容..
有什麼奇怪的東西? –
@KevinPaulKalis,就像divs會碰撞一樣,並且不會和正常顯示尺寸一樣 –
簡單的答案就是使用媒體查詢。 –