我有引导页面,目前只是一个轮播。我想把我的网格集中在一个引导转盘上,但不间断且响应迅速。这可能吗?
我的html结构:
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="myDiv ">
<div class="container">
<div class="row">
<div class="col-md-6 col-lg-6 col-sm-12 col-xs-12">left column..</div>
<div class="col-md-6 col-lg-6 col-sm-12 col-xs-12">right column..</div>
</div>
</div>
</div>
<div class="item active">
<img src="http://www.aurumhotels.com.tr/resimler/normal/2015-08/FirmaArkaBanner1_4BuFjQUcCp3yALBpDUxLsignature.jpg" alt="...">
</div>
<div class="item">
<img src="http://www.aurumhotels.com.tr/resimler/normal/2015-12/FirmaArkaBanner1_Isrgao2xv47jrJVBsf2Hfirmaarkabanner2.png" alt="...">
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</body>
</html>
和我的CSS结构
.myDiv{
position: absolute;
background:#fff;
z-index:1;
}
答案 0 :(得分:0)
您不需要.myDiv css课程。 Bootstrap已预先构建了许多css类,以帮助您的页面布局,如容器和包含流体。而不是以下代码:
<div class="myDiv ">
<div class="container">
<div class="row">
<div class="col-md-6 col-lg-6 col-sm-12 col-xs-12">left column..</div>
<div class="col-md-6 col-lg-6 col-sm-12 col-xs-12">right column..</div>
</div>
</div>
</div>
做一些像:
<div class="container-fluid">
<div class="row">
<div class="col-md-6 col-lg-6 col-sm-12 col-xs-12">left column..</div>
<div class="col-md-6 col-lg-6 col-sm-12 col-xs-12">right column..</div>
</div>
</div>
然后添加样式以覆盖容器流体列以使文本居中。
答案 1 :(得分:0)
你可以添加
.myDiv{
position: absolute;
background:#fff;
z-index:1;
left:50%;
}