Html 我的网站底部有空白
我有个奇怪的问题。在过去的几个小时里,我搜索了很多,所有类似的问题都不能完全由我自己解决 在我的网站中,所有带有第二个斜杠的URL在网站底部都有一个很大的空白。此空间上方的所有站点都是scrollabe 我所有的url中都有相同的CSS文件Html 我的网站底部有空白,html,css,Html,Css,我有个奇怪的问题。在过去的几个小时里,我搜索了很多,所有类似的问题都不能完全由我自己解决 在我的网站中,所有带有第二个斜杠的URL在网站底部都有一个很大的空白。此空间上方的所有站点都是scrollabe 我所有的url中都有相同的CSS文件 http://localhost/testurl http://localhost/testurl/withanotherslash 第一个url没有问题,而第二个url有空白。我在两个URL中检查了相同的html文件 下面是我在第二个url中加载css的
http://localhost/testurl
http://localhost/testurl/withanotherslash
第一个url没有问题,而第二个url有空白。我在两个URL中检查了相同的html文件
下面是我在第二个url中加载css的方式:
<link rel="stylesheet" href="../static/css/bootstrap.min.css" />
<link rel="stylesheet" href="../static/css/jquery-ui.css" />
<link rel="stylesheet" href="../static/css/font-awesome.css" />
<link rel="stylesheet" href="../static/css/unicorn.css" />
我在第二个url中使用两个点,在第一个url中使用一个点。我在Chrome和Firefox中进行了测试
以下是一个屏幕截图:
HTML代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="../static/css/bootstrap.min.css" />
<link rel="stylesheet" href="../static/css/jquery-ui.css" />
<link rel="stylesheet" href="../static/css/font-awesome.css" />
<link rel="stylesheet" href="../static/css/unicorn.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../static/js/jquery.min.js"></script>
<script src="../static/js/bootstrap.min.js"></script>
<script src="../static/js/unicorn.js"></script>
</head>
<body data-color="grey">
<div id="wrapper">
<div id="header">
<div style="width:200px;">
<img style="display:block;margin-left:auto;margin-right:auto;padding-top:5px" src="../static/img/paulie.gif"/>
</div>
</div>
<div id="sidebar">
<div id="search" style="margin-top:80px">
<form method="post" action="/authorsearch">
<input type="text" name='authorname' placeholder="Search for an author...">
<button type="submit"></button>
</form>
</div>
<ul>
<li><a href="/"><i class="fa fa-home"></i><span>Dashboard</span></a></li>
<li><a href="/articles"><i class="fa fa-book"></i><span>Articles</span></a></li>
<li><a href="/editors"><i class="fa fa-user"></i><span>Editors</span></a></li>
<li><a href="/authors"><i class="fa fa-user"></i><span>Authors</span></a></li>
<li><a href="/countries"><i class="fa fa-globe"></i><span>Countries</span></a></li>
<li class="submenu">
<a href="#"><i class="fa fa-flask"></i><span>Settings</span></a>
<ul>
<li><a href="/settings/addarticle"><span>Add an article</span></a></li>
<li><a href="/settings/addauser"><span>Add a user</span></a></li>
<li><a href="/settings/allusers"><span>All users</span></a></li>
</ul>
</li>
</ul>
</div>
<div id="content">
<div id="content-header" class="mini">
<h1>My title</h1>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 center" style="text-align: center;">
<ul class="quick-actions">
<li>
<a href="/">
<i class="icon-home"></i>
Dashboard
</a>
</li>
<li>
<a href="/articles">
<i class="icon-survey"></i>
Articles
</a>
</li>
<li>
<a href="/editors">
<i class="icon-people"></i>
Editors
</a>
</li>
<li>
<a href="/authors">
<i class="icon-people"></i>
Authors
</a>
</li>
<li>
<a href="/countries">
<i class="icon-web"></i>
Countries
</a>
</li>
</ul>
</div>
</div>
<br />
<div class="row">
<div class="col-xs-12">
<div class="widget-box">
<div class="widget-title">
<h5>Users Database</h5>
</div>
<div class="widget-content nopadding">
<table id="myTable" class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Username</th>
<th>Password</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
%for user in users:
<tr>
<td>{{user['username']}}</td>
<td>{{user['password']}}</td>
<td>test</td>
</tr>
%end
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-bottom:0px">
<div id="footer" class="col-xs-12">
2014 © Title. Brought to you by <a href="#">me</a>
</div>
</div>
</div>
</body>
</html>
-
我的头衔
-
-
-
-
-
用户数据库
用户名
密码
删除
%对于用户中的用户:
{{user['username']}
{{user['password']}
测试
%结束
2014年&复印件;标题我给你带来的
CSS文件来自此
这是我在Python瓶子中的后端,以及我如何调用CSS文件:
@bottle.get('/static/css/<filename:re:.*\.css>')
def stylesheets(filename):
return bottle.static_file(filename, root='./static/css/')
@battle.get('/static/css/'))
def样式表(文件名):
return battle.static_文件(文件名,root='./static/css/'))
这就是主题的工作原理。在较短的页面上,您可以在较大的屏幕上看到该间隙
一个简单的解决方案是将正文背景颜色设置为与页脚/包装颜色相同的颜色,从而将页脚颜色扩展到页面底部。例如
body {background: #3c3c3c;}
另一种选择是使用粘性页脚设置,但这会更混乱,而且可能看起来有点愚蠢。请提供HTML标记、CSS或JSFIDLE或页面URL,这将有助于调试!我会马上用代码更新我的问题。我正在使用一个引导主题,我将在我的问题中包括它。看起来像一个没有被使用的粘性页脚。检查css是否有类似于
#wrapper{padding bottom:50px;margin bottom:-50px;}
我在更大的屏幕上检查它,你是对的。你知道如果我把内容的minheight:500px
改成更大的是一个很好的解决方案吗?我这样做了,问题解决了,但我不知道这是否是一种可接受的方法。我不知道这是否是一种可接受的方法
这是一种非常可接受的方法。我在我所有的网站上都这么做。我知道,这是一个比粘贴页脚或最小高度更好的解决方案,这会在内容和页脚之间留下大量无意义的空白。