<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-warning">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#corNavbar02" aria-controls="corNavbar02" aria-expanded="false" aria-label="Alterna navegação">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="corNavbar02">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(Página atual)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Destaques</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Preços</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Sobre</a>
</li>
</ul>
<form class="form-inline">
<input class="form-control mr-sm-2" type="search" placeholder="Pesquisar" aria-label="Pesquisar">
<button class="btn btn-outline-light my-2 my-sm-0" type="submit">Pesquisar</button>
</form>
</div>
</nav>
</header>
<div class="container">
<div class="row">
<div class="col"></div>
<div class="col-6">
<div id="demo" class="carousel slide" data-ride="carousel">
<!-- The slideshow -->
<div class="carousel-inner center-block">
<div class="carousel-item active">
<img src="https://www.adminserver.com.br/imagens_banner/1274.png" alt="Los Angeles">
</div>
<div class="carousel-item">
<img src="https://www.adminserver.com.br/imagens_banner/1275.png" alt="Chicago">
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</div>
<div class="col"></div>
</div>
</div>
<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.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
</body>
</html>
not understood, all this storm just to centralize, this Voce makes using up <center></center>
, if you want responsive, why not use grid ?
copy the code below and paste it on your website
<div class="container">
<div class="row">
<div class="col"></div>
<div class="col-6">
<div id="demo" class="carousel slide" data-ride="carousel">
<!-- The slideshow -->
<div class="carousel-inner center-block">
<div class="carousel-item active">
<img src="https://www.adminserver.com.br/imagens_banner/1274.png" alt="Los Angeles">
</div>
<div class="carousel-item">
<img src="https://www.adminserver.com.br/imagens_banner/1275.png" alt="Chicago">
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</div>
<div class="col"></div>
</div>
</div>
keep <div class="col"></div>
, serves as margin, unless you want to have three columns, then you put the content between the Divs.
Set the margin as follows (replacing the class col
):
Largura máxima do container: (auto) | 540px | 720px | 960px | 1140px
Prefixo em classe .col- | .col-sm- | .col-md- | .col-lg- | .col-xl-
You can use 1 to 6, for example: .col-sm-4
, to approach the next class, or keep .col-sm
to allow the browser to decide.
Jhonattan reading your conversation with in Leandro’s answer I think I understand better what you want. After a glance at my reply I did an edit on it, I just put the standard Bootstrap Row class in the slider div and got 100% wide with centered image.
– hugocsl
Try to place the class "self-align-items" inside your Carousel div.
– Guilherme Sousa