Всем привет!!! Уже 3 день не получается установить адаптивную высоту карусели в % для карусели. Пробовал указывать
высоту для классов carousel-slide(вообще никак не воспринялась) и carousel-inner(работает только в px). Подскажите как это сделать ? Заранее спасибо!!!
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">
<title>Hello, world!</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark sticky-top">
<a href="#" clas="navbar-brand">
<img src="https://i.pinimg.com/originals/c3/c4/fb/c3c4fb131df4376a54720d714ca27166.jpg" alt="logo" height="100px" width="150px"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav active mr-auto">
<li class="nav-item active">
<a href="#" class="nav-link">Home</a>
</li>
<li class="nav-item ">
<a href="#" class="nav-link">Pricing</a>
</li>
<li class="nav-item ">
<a href="#" class="nav-link">About-us</a>
</li>
<li class="nav-item ">
<a href="#" class="nav-link">Support</a>
</li>
</ul>
</div>
</nav>
<div class="carousel slide" data-ride="carousel" id="slides">
<ul class="carousel-indicators">
<li data-target="#slides" data-slide-to="0" class="active"></li>
<li data-target="#slides" data-slide-to="1"></li>
<li data-target="#slides" data-slide-to="2"></li>
<li data-target="#slides" data-slide-to="3"></li>
</ul>
<div class="carousel-inner">
<div class="carousel-item active"><img class="a1" src="image/5-1.jpg">
<div class="carousel-caption b1"><h1 class="display-2">Goodfon</h1>
<button type="button" class="btn btn-outline-light btn-lg">Go</button>
<button type="button" class="btn btn-outline-light btn-lg">Back</button>
</div>
</div>
<div class="carousel-item"><img class="a2" src="image/5v01mTeDIMA.jpg"><div class="carousel-caption b2"><h1 class="display-2">Wallup</h1>
<button type="button" class="btn btn-outline-light btn-lg">Go</button>
<button type="button" class="btn btn-outline-light btn-lg">Back</button>
</div>
</div>
<div class="carousel-item"><img class="a3" src="image/7.jpg"><div class="carousel-caption b3"><h1 class="display-2">Wallbase</h1>
<button type="button" class="btn btn-outline-light btn-lg">Go</button>
<button type="button" class="btn btn-outline-light btn-lg">Back</button>
</div>
</div>
<div class="carousel-item"><img class="a4" src="image/8AWz0Gh4m0Y.jpg"><div class="carousel-caption b4"><h1 class="display-2">Goodfon</h1>
<button type="button" class="btn btn-outline-light btn-lg">Go</button>
<button type="button" class="btn btn-outline-light btn-lg">Back</button>
</div>
</div>
</div
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://use.fontawesome.com/releases/v5.0.8/js/all.js"></script>
</body>
</html>
Вот код от css
html, body,{
width: 100%;
height: 100%;
margin: 0;
}
nav{
background-color: #405d3a;
}
.carousel-inner{
width: 100%;
height: 60%;
}
.a1, .a2, .a3, .a4{
width: 100%;
height: auto;
}
.b1{
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.b2{
position: absolute;
top: 50%;
transform: translateY(-50%)
}
.b3{
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.b4{
position: absolute;
top: 50%;
transform: translateY(-50%);