我正在尝试显示带有全屏幕标量的导航栏,在桌面屏幕上一切正常,但在小屏幕上显示旋转木马下的空白区域。
我整天搜索了一个解决方案,但我找不到解决办法......我从未见过这样的问题:/
这是我的代码:
html{
height:100%;
}
body {
font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
overflow-x: hidden;
}
p {
font-size: 20px;
}
p.small {
font-size: 16px;
}
a,
a:hover,
a:focus,
a:active,
a.active {
color: #18BC9C;
outline: none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
text-transform: uppercase;
font-weight: 700;
}
.img-centered {
margin: 0 auto;
}
/*CAROUSEL HOMEPAGE*/
.carousel .item {
overflow: hidden;
width: 100%; /*slider width*/
max-height: 100vh;
}
.carousel .item img {
width: 100%; /*img width*/
}
.carousel-indicators {
text-align: right;
float: right;
right: 2% !important;
left: inherit;
margin-bottom: 3.75rem;
margin-right: 5.83333rem;
}
.carousel-indicators--round li {
border-radius: 10px;
margin: 1px 3px; /*top,right,bot.left*/
height: 10px;
max-width: 10px;
border: 1px solid transparent;
background-color: #FF7F50 !important;
}
.carousel-indicators .active {
background-color: white !important;
max-width: 15px;
margin: 0 3px;
height: 12px;
}
/*full width container*/
@media (max-width: 767px) {
.carousel .item{
width: 100%;
max-height: 100%;
}
.carousel-indicators{
padding-left: 0px;
}
}
/*END CAROUSEL*/
/*NAVBAR*/
.drop{
color:white !important;
}
.navbar-default .navbar-nav > li.dropdown:hover > a,
.navbar-default .navbar-nav > li.dropdown:hover > a:hover,
.navbar-default .navbar-nav > li.dropdown:hover > a:focus {
background-color: #DC143C;
color: white;
}
li.dropdown:hover > .dropdown-menu {
background-color: #DC143C;
display: block;
}
.navbar-custom {
height: 50px;
background: white;
font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
text-transform: uppercase;
font-weight: 700;
border: none;
}
.navbar-custom a:focus {
outline: none;
}
.navbar-custom .navbar-brand {
color: #DC143C;
}
.navbar-custom .navbar-brand:hover,
.navbar-custom .navbar-brand:focus,
.navbar-custom .navbar-brand:active,
.navbar-custom .navbar-brand.active {
color: #DC143C;
}
.navbar-custom .navbar-nav {
letter-spacing: 1px;
}
.navbar-custom .navbar-nav li a {
color: #DC143C;
}
.navbar-custom .navbar-nav li a:hover {
font-weight: 700;
color: white;
background-color: #DC143C;
outline: none;
}
.navbar-custom .navbar-nav li a:focus,
.navbar-custom .navbar-nav li a:active {
color: white;
}
.navbar-custom .navbar-nav li.active a {
color: #DC143C;
background: white;
}
.navbar-custom .navbar-nav li.active a:hover,
.navbar-custom .navbar-nav li.active a:focus,
.navbar-custom .navbar-nav li.active a:active {
color: white;
background: #DC143C;
}
.navbar-custom .navbar-toggle {
color: #DC143C;
text-transform: uppercase;
font-size: 10px;
border-color: red;
}
.navbar-custom .navbar-toggle:hover,
.navbar-custom .navbar-toggle:focus {
background-color: #DC143C;
color: white;
border-color: #DC143C;
}
@media (min-width: 768px) {
.navbar-custom {
padding: 0px 0;
-webkit-transition: padding 0.3s;
-moz-transition: padding 0.3s;
transition: padding 0.3s;
}
.navbar-custom .navbar-brand {
font-size: 2em;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
}
.navbar-custom.affix {
padding: 10px 0;
}
.navbar-custom.affix .navbar-brand {
font-size: 1.5em;
}
li.dropdown:active > .dropdown-menu {
background-color: #DC143C;
display: block;
}
}
.navbar-default .navbar-collapse, .navbar-default .navbar-form{
background-color: white;
}
/*END NAVBAR*/
<!DOCTYPE html>
<html lang="ita">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="">
<meta name="author" content="">
<title>Immobiliare</title>
<!-- Includo le librerie di bootstrap -->
<link href="librerie_font/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Includo il css generale -->
<link href="css/style.css" rel="stylesheet">
<!-- Includo i font -->
<link href="librerie_font/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Navigation -->
<nav id="mainNav" class="navbar navbar-default navbar-fixed-top navbar-custom">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#menu-imm">
<span class="sr-only">Toggle navigation</span> MENU <i class="fa fa-bars"></i>
</button>
<a class="navbar-brand" href="#page-top">ICONA</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="menu-imm">
<ul class="nav navbar-nav navbar-right">
<li class="hidden">
<a href="#"></a>
</li>
<li class="page-scroll">
<a href="#">Home</a>
</li>
<li class="page-scroll">
<a href="#">Chi Siamo</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Case <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a class = "drop" href="#">IN VENDITA</a></li>
<li><a class = "drop" href="#">IN AFFITTO</a></li>
</ul>
</li>
<li class="page-scroll">
<a href="#contact">Progetti</a>
</li>
<li class="page-scroll">
<a href="#contact">Partecipazioni</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<!-- Header -->
<header>
<div id="sliderHomePage" class="carousel slide" data-interval="3000">
<ol class="carousel-indicators carousel-indicators--round right-0">
<li data-target="#sliderHomePage" data-slide-to="0" class="active ind-c"></li>
<li data-target="#sliderHomePage" data-slide-to="1" class = "ind-c"></li>
<li data-target="#sliderHomePage" data-slide-to="2" class = "ind-c" </li>
</ol>
<div class="carousel-inner">
<div class="active item">
<img src="img/img01.jpg" alt="Slide1" />
</div>
<div class="item">
<img src="img/img01.jpg" alt="Slide2" />
</div>
<div class="item">
<img src="img/img01.jpg" alt="Slide3" />
</div>
</div>
</div>
</header>
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- Plugin JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<!-- Contact Form JavaScript -->
<script src="js/jqBootstrapValidation.js"></script>
<script src="js/contact_me.js"></script>
<!-- Theme JavaScript -->
<script src="js/freelancer.min.js"></script>
<script>
// Activate Carousel
$("#sliderHomePage").carousel("cycle");
</script>
<script>
</script>
</body>
</html>
我真的不知道怎么弄清楚:/
谢谢你们:)
答案 0 :(得分:0)
.carousel .item img {
width: 100%;
height:100%;
}