Bootstrap下拉链接在移动设备上被切断

时间:2014-04-29 15:44:30

标签: html css twitter-bootstrap

这可能是一个简单的样式问题,但我被困住了。我尝试在下拉菜单的LI元素上设置最小高度,仍无济于事。任何援助都会很棒。在屏幕截图中,您可以看到徽标下方显示的一些白色文字。这显然是链接。

enter image description here

样式表:

body {
    background-color: #eee;
    color: #86888A;
    font: 400 16px/28px "Open Sans", Helvetica, Arial, sans-serif;
    word-wrap: break-word;
    text-rendering: optimizelegibility;
    overflow-x: hidden;

}

::selection {
    background: #eaeaea;
    }

#wrap {
    max-width: 900px;
    min-width: 280px;
    margin: 90px auto;
}

/************************HEADER************/
h1 { color: white;}

#header {
    background-color: #121314;
    height: 160px;
    padding-top: 36px;
}

#header a {
    color: white;
    text-decoration: none;
    -webkit-transition: all 0.6s ease;
    -moz-transition: all 0.6s ease;
    transition: all 0.6s ease;
    text-transform: uppercase;
    letter-spacing: 8px;
}

#header a:hover {
    color: #f44238;
}

.navbar-brand {
font-size: 2.00em; 
}


@media (max-width: 510px) {
  .navbar-brand {
    letter-spacing: 8px;
    font-size: 26px;
  }
}

@media (max-width: 450px) {
  .navbar-brand {
    letter-spacing: 6px !important;
    font-size: 18px;
  }
}

.navbar-nav > li{
    font-size: 0.8em;
}

.nav>li>a:hover {
    background-color: transparent;

}

.icon-bar {
    background-color: white;
}

.navbar-nav {
    z-index: 999;
    position: relative;
    background-color:#121314
}


@media (max-width: 990px) {
    .navbar-header {
        float: none;
    }
    .navbar-left,.navbar-right {
        float: none !important;
    }
    .navbar-toggle {
        display: block;
        z-index: 999;
    }
    .navbar-collapse {
        border-top: 1px solid transparent;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
        padding: 0;

    }
    .navbar-collapse.collapse {
        display: none!important;
        padding: 0;

    }
    .navbar-nav {
      float: none!important;
            margin-top: 7.5px;
    }
    .navbar-nav>li {
        float: none;
    }
    .navbar-nav>li>a {
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .collapse.in{
        display:block !important;
        padding: 0;
    }
}



/*********************************/

.row {
    margin-left: 0px !important;
    margin-right: 0px !important;
    max-width: 900px;
    min-width: 280px;
    background-color: white;
}

#content {
    padding-left: 0px !important;
    padding-right: 0px !important;
}

.post {
    margin-bottom: 10%;
}

.postheader {
    font-size: 2.00em;
    margin-bottom: 10px;
}

.postheader a {
    text-decoration: none;
    color: #21282E;
    -webkit-transition: all 0.6s ease;
    -moz-transition: all 0.6s ease;
    transition: all 0.6s ease;
    text-align: left !important;
}

.postheader a:hover {
    color: #f44238;
    cursor: pointer;

}

@media (max-width: 675px) {
  .postheader {
    font-size: 1.7em;
    text-align: center;
  }
}


@media (max-width: 500px) {
  .postheader {
    font-size: 1.2em;
    text-align: center;
  }
}
.meta {
    font-size: 12px;
}

.postimg {
    position: relative;
    width:100%;
    height: 0;
    padding-bottom: 50%;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

.postcontent {
margin: 0 auto;
width: 80%;
text-align: justify;
}

.postcontent p {
    margin: 10px 0 40px;
}

.entity {
    padding-top: 25px;
}

.more-link {
    background-color: black;
    width: 60px;
    height: 30px;
    color: white;
    border-radius: 2px;
    -webkit-border-radius: 2px;
    -moz-border-radius: 2px;
    box-shadow: none;
    text-align: center;
    padding: 6px;
    -webkit-transition: all 0.6s ease;
    -moz-transition: all 0.6s ease;
    transition: all 0.6s ease;
}

.more-link:hover {
    background-color: #f44238;
    text-decoration: none;
    color: white;
}






hr {
  margin-top: 40px;
  background-color: none;
  height: 1px;
  border: none;
}
hr::after {
  display: block;
  width: 125%;
  height: 1px;
  background-color: tomato;
  position: relative;
  left: -25%;
  top: 1px;
  content: "/";
  color: tomato;
  text-align: right;
  line-height: 0px;
}
hr::before {
  display: block;
  width: 125%;
  height: 1px;
  background-color: tomato;
  position: relative;
  left: -25%;
  top: -1px;
  content: "|";
  color: tomato;
  text-indent: -1px;
  line-height: 6px;
}

.pagination>li>a {
    color: #f44238;
}

.pagination>li>a:hover {
    color:#f44238;
}

.pagination>.active>a {
    background-color: black;
    border: 0px;
}

.pagination>.active>a:hover {
    background-color:black;
}

.portfolio-item {
    margin-bottom: 25px;
    margin-top: 35px;
}

.portfolio-item>h3 {
    text-align: center;
}

.portfolio-item>p {
    text-align: center;
}

2 个答案:

答案 0 :(得分:1)

将此添加到媒体查询

.navbar-collapse.in {
 overflow-y: visible;
}

答案 1 :(得分:0)

问题是,如果您将窗口调整到非常小的尺寸,菜单按钮会分解到下拉列表所需的空间。

修复可能是:

.navbar-toggle {
    background-color: rgba(0, 0, 0, 0);
    background-image: none;
    border: 1px solid rgba(0, 0, 0, 0);
    border-radius: 4px;
    float: right;
    margin-bottom: 8px;
    margin-right: 15px;
    margin-top: 8px;
    padding: 9px 10px;
    position: absolute; <--
    right: 0; <--
}

.navbar-header {
    position: relative;
}

并读取overflow-x:hidden;