【发布时间】:2016-12-14 16:38:24
【问题描述】:
我正在尝试使用 Zurb 的 Foundation for Sites 创建全屏布局。我需要使用屏幕的整个宽度。我还希望在屏幕左侧有两列用于导航。布局将如下所示:
+--------+--------+---------------------+
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
+--------+--------+---------------------+
左两列将是固定大小。但是,最远的列需要占用剩余空间。为了尝试构建它,我目前编写了以下代码:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<link rel="icon" type="image/png" href="/resources/root/images/favicon.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.0/css/foundation.min.css" />
<style type="text/javascript">
. .app {
height: 100%;
width: 100%;
position: relative;
overflow: hidden;
}
.app-col {
height: 100%;
}
</style>
</head>
<body>
<div class="app">
<div class="row">
<div class="app-col large-2 columns" style="background-color:blue;">
<div class="title-2">Here</div>
<nav>
<div><a href="/location-1">Nav 1</a></div>
<div><a href="/location-2">Nav 2</a></div>
</nav>
</div>
<div class="app-col large-2 columns" style="background-color:red;">
<nav>
<div><a href="/location-a">Sub Nav 1</a></div>
<div><a href="/location-b">Sub Nav 2</a></div>
</nav>
</div>
<div class="app-col large-8 columns">
content
</div>
</div>
</div>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.0/js/foundation.min.js"></script>
</body>
</html>
不幸的是,当我运行它时 1) 布局似乎只占屏幕的约 70% 并且 2) 它没有填满屏幕的整个高度。
我做错了什么?
【问题讨论】:
标签: css zurb-foundation