侧导航栏不是全高

时间:2015-10-27 11:46:55

标签: html css twitter-bootstrap-3

我有这个小提琴,https://jsfiddle.net/wqbn6pe6/2/

它是一个简单的侧面导航,然而网格使侧边没有伸展到底部,即使sidenav的高度为100%

任何帮助?

继承代码

HTML:

<div class="sidenav right">
  <div class="nav active"><div class="icon fa fa-home"></div><div class="description">Home</div></div>
  <div class="nav"><div class="icon fa fa-database"></div><div class="description">About</div></div>
  <div class="nav"><div class="icon fa fa-users"></div><div class="description">Clients</div></div>
</div>
<div class="col-md-12">

  <span class="toggler active" data-toggle="grid"><span class="entypo-layout"></span></span>
<span class="toggler" data-toggle="list"><span class="entypo-list"></span></span>

<ul class="surveys grid">
  <li class="survey-item">

    <span class="survey-country list-only">
      UK
    </span>

    <span class="survey-name">
      UK Beer May 2014
    </span>

    <span class="survey-country grid-only">
      UK
    </span>

    <div class="pull-right">

      <span class="survey-progress">
        <span class="survey-progress-bg">
          <span class="survey-progress-fg" style="width: 88%;"></span>
        </span>

        <span class="survey-progress-labels">
          <span class="survey-progress-label">
            88%
          </span>

          <span class="survey-completes">
            490 / 500
          </span>
        </span>
      </span>

       <span class="survey-end-date ended">
        2014 - May 10
      </span>
      <span class="survey-stage">
        <span class="stage draft">Draft</span>
        <span class="stage awarded">Awarded</span>
        <span class="stage live">Live</span>
        <span class="stage ended active">Ended</span>
      </span>
    </div>
  </li>
  <li class="survey-item">
    <span class="survey-country list-only">
      US
    </span>

    <span class="survey-name">
      Pepsi Tracker New Orleans
    </span>

    <span class="survey-country grid-only">
      US
    </span>

    <div class="pull-right">

      <span class="survey-progress">
        <span class="survey-progress-bg">
          <span class="survey-progress-fg" style="width: 25%;"></span>
        </span>

        <span class="survey-progress-labels">
          <span class="survey-progress-label">
            25%
          </span>

          <span class="survey-completes">
            150 / 500
          </span>
        </span>
      </span>

       <span class="survey-end-date">
        2014 - July 12
      </span>
      <span class="survey-stage">
        <span class="stage draft">Draft</span>
        <span class="stage awarded">Awarded</span>
        <span class="stage live active">Live</span>
        <span class="stage ended">Ended</span>
      </span>
    </div>
  </li>
  <li class="survey-item">
    <span class="survey-country list-only">
      US
    </span>

    <span class="survey-name">
      Pepsi Tracker New Orleans
    </span>

    <span class="survey-country grid-only">
      US
    </span>

    <div class="pull-right">

      <span class="survey-progress">
        <span class="survey-progress-bg">
          <span class="survey-progress-fg" style="width: 25%;"></span>
        </span>

        <span class="survey-progress-labels">
          <span class="survey-progress-label">
            25%
          </span>

          <span class="survey-completes">
            150 / 500
          </span>
        </span>
      </span>

       <span class="survey-end-date">
        2014 - July 12
      </span>
      <span class="survey-stage">
        <span class="stage draft">Draft</span>
        <span class="stage awarded">Awarded</span>
        <span class="stage live active">Live</span>
        <span class="stage ended">Ended</span>
      </span>
    </div>
  </li>
  <li class="survey-item">
    <span class="survey-country list-only">
      US
    </span>

    <span class="survey-name">
      Pepsi Tracker New Orleans
    </span>

    <span class="survey-country grid-only">
      US
    </span>

    <div class="pull-right">

      <span class="survey-progress">
        <span class="survey-progress-bg">
          <span class="survey-progress-fg" style="width: 25%;"></span>
        </span>

        <span class="survey-progress-labels">
          <span class="survey-progress-label">
            25%
          </span>

          <span class="survey-completes">
            150 / 500
          </span>
        </span>
      </span>

       <span class="survey-end-date">
        2014 - July 12
      </span>
      <span class="survey-stage">
        <span class="stage draft">Draft</span>
        <span class="stage awarded">Awarded</span>
        <span class="stage live active">Live</span>
        <span class="stage ended">Ended</span>
      </span>
    </div>
  </li>
  <li class="survey-item">
    <span class="survey-country list-only">
      US
    </span>

    <span class="survey-name">
      Global Music Brand Tracker
    </span>

    <span class="survey-country grid-only">
      US
    </span>

    <div class="pull-right">
      <span class="survey-end-date">
        2014 - Oct 1
      </span>
      <span class="survey-stage">
        <span class="stage draft">Draft</span>
        <span class="stage awarded active">Awarded</span>
        <span class="stage live">Live</span>
        <span class="stage ended">Ended</span>
      </span>
    </div>
  </li>
</ul>
</div>

CSS

@import url(http://fonts.googleapis.com/css?family=Roboto);
@import url(//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css);

* {
font-family: Roboto;
}

/*body {
margin: 0px;
padding: 0px;
overflow-x: hidden;
}*/

.sidenav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: absolute;
  right: 0px;
  top: 0px;
  height: 100%;
  width: 60px;
  background: #333;
}


  .sidenav .nav {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1000;
    left: 0px;
    transition: all 0.4s ease;
    cursor: pointer;
  }

  .sidenav .nav.active {
    left: -10px;
  }

  .sidenav .nav:hover {
    left: -85px;      /* Border width*2 */
  }

    .sidenav .description, .sidenav .icon {
      height: 60px;
      line-height: 60px;
      background: #333;
    }

    .sidenav .nav.active .description, .sidenav .nav.active .icon {
      background: #ED7710;
    }

    .sidenav .icon {
      width: 60px;          /* Width of navbar */
      text-align: center;
      color: #e9e9e9;
      font-size: 25px;
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
    }

    .sidenav .description {
      position: relative;
      left: 60px;
      color: #eee;
      min-width: 80px;
      padding-left: 20px;
      height: 100%;
    }

.content {
  position: absolute;
  left: 0px;
  top: 0px;
  right: 60px;        /* Width of navbar */
  height: 100%;
  z-index: 10;
  background: #ddd;
}
@import url(http://fonts.googleapis.com/css?family=Lato:300,400,700);
@import url(http://weloveiconfonts.com/api/?family=entypo);
/* entypo */
[class*="entypo-"]:before {
font-family: 'entypo', sans-serif;
}

* {
box-sizing: border-box;
}

body {
background: #f5f5f5;
max-width: 1200px;
margin: 0 auto;
padding: 10px;
font-family: 'Lato', sans-serif;
text-shadow: 0 0 1px rgba(255, 255, 255, 0.004);
font-size: 100%;
font-weight: 400;
}

.toggler {
color: #A1A1A4;
font-size: 1.25em;
margin-left: 8px;
text-align: center;
cursor: pointer;
}
.toggler.active {
color: #000;
}

.surveys {
list-style: none;
margin: 0;
padding: 0;
}

.survey-item {
display: block;
margin-top: 10px;
padding: 20px;
border-radius: 2px;
background: white;
box-shadow: 0 2px 1px rgba(170, 170, 170, 0.25);
}

.survey-name {
font-weight: 400;
}

.list .survey-item {
position: relative;
padding: 0;
font-size: 14px;
line-height: 40px;
}
.list .survey-item .pull-right {
position: absolute;
right: 0;
top: 0;
}
@media screen and (max-width: 800px) {
.list .survey-item .stage:not(.active) {
  display: none;
}
}
@media screen and (max-width: 700px) {
.list .survey-item .survey-progress-bg {
  display: none;
}
}
@media screen and (max-width: 600px) {
.list .survey-item .pull-right {
  position: static;
  line-height: 20px;
  padding-bottom: 10px;
}
}
.list .survey-country,
.list .survey-progress,
.list .survey-completes,
.list .survey-end-date {
color: #A1A1A4;
}
.list .survey-country,
.list .survey-completes,
.list .survey-end-date,
.list .survey-name,
.list .survey-stage {
margin: 0 10px;
}
.list .survey-country {
margin-right: 0;
}
.list .survey-end-date,
.list .survey-completes,
.list .survey-country,
.list .survey-name {
vertical-align: middle;
}
.list .survey-end-date {
display: inline-block;
width: 100px;
white-space: nowrap;
overflow: hidden;
}

.survey-stage .stage {
display: inline-block;
vertical-align: middle;
width: 16px;
height: 16px;
overflow: hidden;
border-radius: 50%;
padding: 0;
margin: 0 2px;
background: #f2f2f2;
text-indent: -9999px;
color: transparent;
line-height: 16px;
}
.survey-stage .stage.active {
background: #A1A1A4;
}

.list .list-only {
display: auto;
}
.list .grid-only {
display: none !important;
}

.grid .grid-only {
display: auto;
}
.grid .list-only {
display: none !important;
}

.grid .survey-item {
position: relative;
display: inline-block;
vertical-align: top;
height: 200px;
width: 250px;
margin: 10px;
}
@media screen and (max-width: 600px) {
.grid .survey-item {
  display: block;
  width: auto;
  height: 150px;
  margin: 10px auto;
}
}
.grid .survey-name {
display: block;
max-width: 80%;
font-size: 16px;
line-height: 20px;
}
.grid .survey-country {
font-size: 11px;
line-height: 16px;
text-transform: uppercase;
}
.grid .survey-country,
.grid .survey-end-date {
color: #A1A1A4;
}
.grid .survey-end-date:before {
content: 'Ends\00a0';
}
.grid .survey-end-date.ended:before {
content: 'Ended\00a0';
}
.grid .survey-progress {
display: block;
position: absolute;
bottom: 0;
left: 0;
right: 0;
width: 100%;
padding: 20px;
border-top: 1px solid #eee;
font-size: 13px;
}
.grid .survey-progress-bg {
width: 40%;
display: block;
}
@media screen and (max-width: 200px) {
.grid .survey-progress-bg {
  display: none;
}
}
.grid .survey-progress-labels {
position: absolute;
right: 20px;
top: 0;
line-height: 40px;
}
@media screen and (max-width: 200px) {
.grid .survey-progress-labels {
  right: auto;
  left: 10px;
}
}
.grid .survey-progress-label {
line-height: 21px;
font-size: 13px;
font-weight: 400;
}
.grid .survey-completes {
line-height: 21px;
font-size: 13px;
vertical-align: middle;
}
.grid .survey-stage {
position: absolute;
top: 20px;
right: 20px;
}
.grid .survey-stage .stage {
display: none;
}
.grid .survey-stage .active {
display: block;
}
.grid .survey-end-date {
font-size: 12px;
line-height: 20px;
}

.survey-progress-label {
vertical-align: middle;
margin: 0 10px;
color: #8DC63F;
}

.survey-progress-bg {
display: inline-block;
vertical-align: middle;
position: relative;
width: 100px;
height: 4px;
border-radius: 2px;
overflow: hidden;
background: #eee;
}

.survey-progress-fg {
position: absolute;
top: 0;
bottom: 0;
height: 100%;
left: 0;
margin: 0;
background: #8DC63F;
}

萨姆

1 个答案:

答案 0 :(得分:5)

更改

.sidenav {
    position: absolute;
}

 position: fixed;