Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 网站的全屏布局 我试图用Zurb的网站创建一个全屏布局。我需要使用屏幕的全宽。我还希望在屏幕左侧有两列用于导航。布局将如下所示: +--------+--------+---------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +--------+--------+---------------------+_Css_Zurb Foundation - Fatal编程技术网

Css 网站的全屏布局 我试图用Zurb的网站创建一个全屏布局。我需要使用屏幕的全宽。我还希望在屏幕左侧有两列用于导航。布局将如下所示: +--------+--------+---------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +--------+--------+---------------------+

Css 网站的全屏布局 我试图用Zurb的网站创建一个全屏布局。我需要使用屏幕的全宽。我还希望在屏幕左侧有两列用于导航。布局将如下所示: +--------+--------+---------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +--------+--------+---------------------+,css,zurb-foundation,Css,Zurb Foundation,左两列的大小将是固定的。但是,最远的列需要占用剩余的空间。为了构建此功能,我目前编写了以下代码: <!DOCTYPE html> <html> <head> <title>Page Title</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta charset="UTF-8"&

左两列的大小将是固定的。但是,最远的列需要占用剩余的空间。为了构建此功能,我目前编写了以下代码:

<!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它没有填满整个屏幕的高度


第一个问题,那是因为应用了Zurb的基础类行,可以包含一个自定义类来重写并具有完全的宽度,例如:

.fullwidth {
   width: 100%;
   height: 100%;
   margin-left: auto;
   margin-right: auto;
   max-width: initial;
}
因此,第二个问题可以通过一个名为

检查这个

也许另一个解决方案是使用一些javascript,比如

HTML:


这是旧的,但只是以防万一其他人正在寻找这个答案。基金会6现在有一个类,你可以用它来达到100%的宽度。只需使用扩展的类

<div class="row expanded">
 content goes here
</div>
.app {
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.app-col {
    height: 100%;
}

.fullwidth {
   width: 100%;
   height: 100%;
   margin-left: auto;
   margin-right: auto;
   max-width: initial;
}
<div class="row expanded">
 content goes here
</div>