I have a search box and i want it to overlay on the carousel. Like how it is displayed in the image. I am able to achieve it by positioning the search box Absolute. But it's not responsive. As the width reduces it doesn't stay inside the carousel. How do I make it responsive ??
Here's my code.
<div class="container-fluid search_bar">
<row>
<div class="col-xs-7 search">
<div class="navbar nav1" role="navigation">
<div class="navbar-header">
<form class="navbar-form form1 " role="search">
<div class="">
<input type="text" class="form_input" placeholder="Type Hospital Name" style="float:left; width: 27%; margin-top: 0; margin-right: 3%;" name="srch-term" id="srch-term">
<select style="float: left; padding: 1px; width: 27%; margin-right: 3%;" class="selectbox1 form_input" >
<option> Speciality </option>
<option> Search in Health Packages </option>
<option> Search in Diagnostic Centres </option>
<option> Search in Doctors </option>
<option> Search in Tests </option>
</select>
<input type="text" class="form_input" placeholder="Type Location" style="float:left; width: 27%; margin-right: 6" name="srch-term" id="srch-term">
<button class="form_button" style="padding: 4px;" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</form>
</div></div></div>
<div class="col-xs-5" style="border: none !important; ">
<div class="social-media">
<ul class="list-unstyled list-inline">
<li> <img src="images/facebook.png" class="img-responsive" style="cursor: pointer;"/> </li>
<li> <img src="images/twitter.png" class="img-responsive" style="cursor: pointer;"/> </li>
<li> <img src="images/google.png" class="img-responsive" style="cursor: pointer;"/> </li>
</ul>
</div>
</div>
</row>
</div>
<div class="col-xs-12">
<div id="myCarousel" class="carousel slide slider" data-ride="carousel">
<!-- Indicators
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol> -->
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="images/homeimage1.jpg" class="img-responsive" >
</div>
<div class="item">
<img src="images/homeimage1.jpg" class="img-responsive" >
</div>
<div class="item">
<img src="images/homeimage1.jpg" class="img-responsive">
</div>
<div class="item">
<img src="images/homeimage1.jpg" class="img-responsive">
</div>
</div>
<!-- Left and right controls -->
<div class="right carousel-control" style="right: -5%; cursor: pointer;" href="#myCarousel" data-slide="next">
<span> <img src="images/right.png" class="img-responsive"/></span>
</div>
<div class="left carousel-control" style="left: 4%; cursor: pointer;" href="#myCarousel" data-slide="prev">
<span> <img src="images/left.png" class="img-responsive"/></span>
</div>
</div>
</div>
here's the CSS
.search_bar {
position: relative;
top: 91px;
left: 10%;
/* margin-left: -0.5%; */
}
.search_bar1 {
position: absolute;
z-index: 3;
margin-top: 8%;
margin-left: 10% !important;
}
#media (max-width: 768px) {
.search_bar1 {
margin-top: 0;
}
}
There is quite a lot of content being displayed within the seach bar and this causes a problem on smaller devices, so I have implemented a possible solution for you here. Basically, on a small display, the search bar will re-position itself under the carousel. You should find that the search bar reacts responsively as the display size changes. I have adjusted your social media icons to sit in a new row below the search options as I think it makes better use of the available space. Of course, it is difficult to know exactly what your requirements are here but I hope this helps. Any questions please let me know.
.navbar-header { width:100%; }
.search_bar {
width:50%;
position: absolute;
z-index:1;
top: 91px;
left: 5%;
/* margin-left: -0.5%; */
}
.search_bar select, .search_bar input, .search_bar button { float:left; margin-top:2px; }
#media (max-width: 500px) {
.search_bar {
position:relative;
top:0;
left:0;
width:100%;
}
}
<div class="col-xs-12">
<div id="myCarousel" class="carousel slide slider" data-ride="carousel">
<!-- Indicators
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol> -->
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="images/homeimage1.jpg" class="img-responsive" >
</div>
<div class="item">
<img src="images/homeimage1.jpg" class="img-responsive" >
</div>
<div class="item">
<img src="images/homeimage1.jpg" class="img-responsive">
</div>
<div class="item">
<img src="images/homeimage1.jpg" class="img-responsive">
</div>
</div>
<!-- Left and right controls -->
<div class="right carousel-control" style="right: -5%; cursor: pointer;" href="#myCarousel" data-slide="next">
<span> <img src="images/right.png" class="img-responsive"/></span>
</div>
<div class="left carousel-control" style="left: 4%; cursor: pointer;" href="#myCarousel" data-slide="prev">
<span> <img src="images/left.png" class="img-responsive"/></span>
</div>
</div>
<div class="container-fluid search_bar">
<div class="row">
<div class="col-xs-12 search">
<div class="navbar nav1" role="navigation">
<div class="navbar-header">
<form class="navbar-form form1 " role="search">
<div class="">
<input type="text" class="form_input" placeholder="Type Hospital Name" style="margin-top: 0; margin-right: 3%;" name="srch-term" id="srch-
term">
<select style="float: left; padding: 3px; margin-right: 3%;" class="selectbox1 form_input" >
<option> Speciality </option>
<option> Search in Health Packages </option>
<option> Search in Diagnostic Centres </option>
<option> Search in Doctors </option>
<option> Search in Tests </option>
</select>
<input type="text" class="form_input" placeholder="Type Location" style="margin-right:3%;" name="srch-term" id="srch-term">
<button class="form_button" style="padding: 4px;" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12" style="border: none !important; ">
<div class="social-media">
<ul class="list-unstyled list-inline">
<li> <img src="images/facebook.png" class="img-responsive" style="cursor: pointer;"/> </li>
<li> <img src="images/twitter.png" class="img-responsive" style="cursor: pointer;"/> </li>
<li> <img src="images/google.png" class="img-responsive" style="cursor: pointer;"/> </li>
</ul>
</div>
</div>
</div>
</div>
</div>
Related
I have a strange problem with my css grid. I have a 2 columns grid:
.main-container {
top: 0;
display: grid;
background-image: url('https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/wal.png');
background-attachment: fixed;
grid-template-columns: 50% 50%;
box-sizing: border-box;
font-size: 1.5rem;
z-index: -1;
}
#media all and (max-width: 890px) {
.main-container {
grid-auto-flow: row dense;
grid-auto-columns: 1fr;
}
.main-container div {
grid-column: 1 / span 3;
}
}
<div class="main-container">
<div class="item1 cnt">
<video id="vid" src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/coffee1.mp4" width="1920" height="1080" autoplay loop muted type="video/mp4"> </video>
</div>
<div class="item2 cnt">
<p style="font-size:50px; color:white;"> Join Us! </P>
<button type="button" class="btn btn-outline-warning" style="font-family:forum; font-weight:bold; background-color:#1f1f1f; border-radius: 25px; color:#edbd87; font-size:40px; border: 2px solid #edbd87;" onclick="location.href='http://arvanjobs.com/candidates'">SEND YOUR CV</button>
</div>
<div class="item3 cnt">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/LOGO.png" />
</div>
<div class="item4 cnt">
</div>
<div class="item5 cnt">
<h4>WHO WE ARE?</h4>
<p>
ArvanJobs is above all peace of mind. It is a new way of working, of traveling, of training, of advancing in your career. Whether you are a company looking for workers or you are looking for a new job opportunity, ArvanJobs will always be by your side,
selecting the best workers and the best companies that will boost your career.
</p>
</div>
<div class="item6 cnt">
<h4>WHY WORK WITH US?</h4>
<p>
For our personal treatment, our advice, and above all for our experience working in hotels in numerous countries. Because we know how difficult it is to take that step of daring to work in a foreign country. Because we know how hard it is to find the
right staff.
</p>
</div>
<div class="item7 cnt">
</div>
<div class="item8 cnt">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/arvan3.jpg">
</div>
<div class="item9 cnt">
<h4>HOW WE WORK?</h4>
<p>
All candidates are interviewed by staff who have worked in hotels, not offices. The same happens with our clients who have to satisfy a series of criteria and guarantees for the worker to work with us.</p>
</div>
<div class="item13 cnt">
<div class="item13-1">
<p>APPLY NOW TO GET STARTED</p>
</div>
<div class="item13-2">
<button type="button" class="btn btn-outline-warning" style="font-family:forum; font-weight:bold; background-color:#967b5d; border-radius: 25px; color:#edbd87; font-size:40px; border: 2px solid #edbd87;" onclick="location.href='http://arvanjobs.com/candidates'">APPLY NOW</button>
</div>
</div>
<div class="item10 cnt">
<div class="container" style="width:100vw; max-width: max-content; padding-left: 0px; padding-right: 0px;">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>
-->
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/0.png" alt="Reception" style="width:100vw;">
<div class="carousel-caption">
<h3 style="color:white;">Chefs</h3>
<p>LA is always so much fun!</p>
</div>
</div>
<div class="item">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/1.png" alt="housekeeping" style="width:100vw;">
<div class="carousel-caption">
<h3 style="color:white;">Waiters</h3>
<p>Thank you, Chicago!</p>
</div>
</div>
<div class="item">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/2.png" alt="chefs" style="width:100vw;">
<div class="carousel-caption">
<h3 style="color:white;">Housekeeping</h3>
<p>We love the Big Apple!</p>
</div>
</div>
<div class="item">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/3.png" alt="awijr" style="width:100vw;">
<div class="carousel-caption">
<h3 style="color:white;">Reception</h3>
<p>We love the Big Apple!</p>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
<div class="item11 cnt">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/arvan2.jpg" />
</div>
<div class="item12 cnt">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/arvan2-1.png" />
</div>
I encounter this when reaching the 400~ px. mark (I have no css for this range of width):
Its like the .main-container its getting a responsive, and some items from inside it, getting other different responsive. I don't understand, and my CSS is very long to post all of it here. You can see this mess at https://arvanjobs.com
It's much easier to add in complexity with media queries than remove it.
So have your mobile styles in your regular CSS, and then add in what you want to happen on larger screen widths.
* {
max-width: 100%;
}
.main-container {
top: 0;
display: grid;
background-image: url('https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/wal.png');
background-attachment: fixed;
grid-auto-flow: row dense;
grid-auto-columns: 1fr;
box-sizing: border-box;
font-size: 1.5rem;
z-index: -1;
}
#media all and (min-width: 890px) {
.main-container {
grid-template-columns: 50% 50%;
}
}
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<div class="main-container">
<div class="item1 cnt">
<video id="vid" src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/coffee1.mp4" autoplay loop muted type="video/mp4"> </video>
</div>
<div class="item2 cnt">
<p style="font-size:50px; color:white;"> Join Us! </P>
<button type="button" class="btn btn-outline-warning" style="font-family:forum; font-weight:bold; background-color:#1f1f1f; border-radius: 25px; color:#edbd87; font-size:40px; border: 2px solid #edbd87;" onclick="location.href='http://arvanjobs.com/candidates'">SEND YOUR CV</button>
</div>
<div class="item3 cnt">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/LOGO.png" />
</div>
<div class="item4 cnt">
</div>
<div class="item5 cnt">
<h4>WHO WE ARE?</h4>
<p>
ArvanJobs is above all peace of mind. It is a new way of working, of traveling, of training, of advancing in your career. Whether you are a company looking for workers or you are looking for a new job opportunity, ArvanJobs will always be by your side,
selecting the best workers and the best companies that will boost your career.
</p>
</div>
<div class="item6 cnt">
<h4>WHY WORK WITH US?</h4>
<p>
For our personal treatment, our advice, and above all for our experience working in hotels in numerous countries. Because we know how difficult it is to take that step of daring to work in a foreign country. Because we know how hard it is to find the
right staff.
</p>
</div>
<div class="item7 cnt">
</div>
<div class="item8 cnt">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/arvan3.jpg">
</div>
<div class="item9 cnt">
<h4>HOW WE WORK?</h4>
<p>
All candidates are interviewed by staff who have worked in hotels, not offices. The same happens with our clients who have to satisfy a series of criteria and guarantees for the worker to work with us.</p>
</div>
<div class="item13 cnt">
<div class="item13-1">
<p>APPLY NOW TO GET STARTED</p>
</div>
<div class="item13-2">
<button type="button" class="btn btn-outline-warning" style="font-family:forum; font-weight:bold; background-color:#967b5d; border-radius: 25px; color:#edbd87; font-size:40px; border: 2px solid #edbd87;" onclick="location.href='http://arvanjobs.com/candidates'">APPLY NOW</button>
</div>
</div>
<div class="item10 cnt">
<div class="container" style="max-width: max-content; padding-left: 0px; padding-right: 0px;">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>
-->
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/0.png" alt="Reception">
<div class="carousel-caption">
<h3 style="color:white;">Chefs</h3>
<p>LA is always so much fun!</p>
</div>
</div>
<div class="item">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/1.png" alt="housekeeping">
<div class="carousel-caption">
<h3 style="color:white;">Waiters</h3>
<p>Thank you, Chicago!</p>
</div>
</div>
<div class="item">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/2.png" alt="chefs">
<div class="carousel-caption">
<h3 style="color:white;">Housekeeping</h3>
<p>We love the Big Apple!</p>
</div>
</div>
<div class="item">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/3.png" alt="awijr">
<div class="carousel-caption">
<h3 style="color:white;">Reception</h3>
<p>We love the Big Apple!</p>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
<div class="item11 cnt">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/arvan2.jpg" />
</div>
<div class="item12 cnt">
<img src="https://www.arvanjobs.com/wp-content/themes/twentytwentyone-child/img/arvan2-1.png" />
</div>
</body>
I'm working on a project for school. I must make a website with Bootstrap 3 exactly like this:image 1 and image 2.
I'm almost done with the page, but I am stuck. I want indicator numbers like the picture where I marked in black.
How can I create indicators like that?
After searching on internet I got something like this: https://www.codeseek.co/danbhala/bootstrap-carousel-indicator-with-numbers-gpWvxG. The problem is I can't make the number red after the page has been visited.
Thanks for the help.
Sorry for the bad picture and my English. If something is not clearly stated, ask a question I will answer it.
*{
margin: 0;
}
html, body {
height: 100%;
background-color: rgb(228, 228, 228);
}
#content-container {
height: auto !important;
min-height: 100%;
margin: 0 auto;
}
.panel {
width: 99%;
margin-left: 0.4%;
box-shadow: 4px 4px 8px 0 rgba(0, 0, 0, 0.2),
0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
#footer {
min-height: 18%;
margin-top: 2%;
padding-top: 2%;
background-color: rgba(193, 188, 188, 0.55);
font-size: 12px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/SelectDate.css">
<title>Werken met Bootstrap</title>
</head>
<body>
<!-- Begin content-container -->
<div id="content-container">
<!-- Begin navbar -->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="Index.html"><i class="fa fa-building-o" style="font-size:19px; color:red"> </i><b> Hotel</b> Booking</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li>Home</li>
<li>Explore Hotels</li>
<li>Contact Us</li>
</ul>
</div>
</nav>
<!-- End navbar -->
<!-- Begin Container -->
<div class="container">
<h3><b>The Student Hotel The Hague</b></h3>
<br>
<div id="myCarousel" class="carousel slide" data-interval="false">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active">1</li>
<li data-target="#myCarousel" data-slide-to="1">2</li>
<li data-target="#myCarousel" data-slide-to="2">3</li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<div class="panel panel-defualt">
<div class="panel-body">
<p>Welcome! Let's book a room you'll love.<br>
Please provide us with the information started below, we will handle the data with care.
</p>
<hr>
<div class="row">
<div class="col-md-2" style="padding-top: 3%;">
<label class="radio-inline"><input type="radio" name="optradio">Mr</label>
<label class="radio-inline"><input type="radio" name="optradio">Mrs</label>
</div>
<div class="form-group col-md-5">
First name:
<input type="text" class="form-control" placeholder="Enter first name">
</div>
<div class="form-group col-md-5">
Last name:
<input type="text" class="form-control" placeholder="Enter last name">
</div>
</div>
<br>
<div class="row">
<div class="col-md-4">
Departure Date
<input type="text" class="form-control" placeholder="dd-mm-jjjj">
</div>
<div class="col-md-4">
Return Date
<input type="text" class="form-control" placeholder="dd-mm-jjjj">
</div>
<div class="col-md-4">
Rooms
<select class="form-control">
<option>1 Room</option>
<option>2 Room</option>
<option>3 Room</option>
<option>4 Room</option>
</select>
</div>
</div>
<hr>
<div class="pull-right">
Cancel <a href="#myCarousel" data-slide="next"><button type="button" class="btn btn-danger">Pick a room <b>></b></button>
</a>
</div>
</div>
</div>
</div>
<div class="item">
<img src="image/hotel.jpg">
</div>
<div class="item">
<img src="image/hotel2.jpg">
</div>
</div>
</div>
</div>
<!-- End Container -->
</div>
<!-- End content-contrainer -->
<!-- Begin Footer -->
<div id="footer">
<div class="container text-left">
<div class="row">
<!--First column-->
<div class="col-md-4">
<h6 class="mb-4 mt-3 font-weight-bold"><i class="fa fa-building-o" style="font-size:14px;"><b> Hotel</b> Booking</i></h6>
<ul class="list-unstyled">
<li>
Niewmansstraat 123
</li>
<li>
1234 AB The Hague
</li>
<li>
The Netherlands
</li>
<li>
<br>
© 2018 Hotel Booking
</li>
</ul>
</div>
<!--/.First column-->
<b>
<!--Second column-->
<div class="col-md-4">
<h5 class="mb-4 mt-3 font-weight-bold"><b>Useful links</b></h5>
<ul class="list-unstyled">
<li>
Explore hotels
</li>
<li>
Reviews
</li>
<li>
A link
</li>
<li>
Another link
</li>
<li>
Different link
</li>
</ul>
</div>
<!--/.Second column-->
<!--Third column-->
<div class="col-md-4">
<h5 class="mb-4 mt-3 font-weight-bold"><b>The Company</b></h5>
<ul class="list-unstyled">
<li>
About
</li>
<li>
Careers
</li>
<li>
Press centre
</li>
<li>
Terms & Conditions
</li>
<li>
Contact us
</li>
</ul>
</div>
<!--/.Third column-->
</b>
</div>
</div>
</div>
<!-- End Footer -->
</body>
</html>
CSS:
.carousel-indicators-numbers li {
text-indent: 0;
margin: 0 2px;
width: 30px;
height: 30px;
border: none;
border-radius: 100%;
line-height: 30px;
color: #fff;
background-color: #999;
transition: all 0.25s ease;
}
.carousel-indicators-numbers li.visited, .carousel-indicators-numbers li:hover, .carousel-indicators-numbers li.active {
margin: 0 2px;
width: 30px;
height: 30px;
background-color: red;
}
HTML:
<ol class="carousel-indicators carousel-indicators-numbers">
<li data-target="#myCarousel" data-slide-to="0" class="active">1</li>
<li data-target="#myCarousel" data-slide-to="1">2</li>
<li data-target="#myCarousel" data-slide-to="2">3</li>
</ol>
I'm working with a Bootstrap 3 carousel. Here is what I have done far, I want it to look similar to this.
Why does the slide preview from column 2 anytime I click the arrows? Is there a way to hide the preview from showing up when clicking next/previous
Anytime I click past two slides, it errors out and doesn't go back to the first slide.
<style type="text/css">
/* #information, #video {
width: 50%; //CSS styling for table tags.
} */
.linebreak {
display: none;
}
.image {
float: left!important;
}
.carousel slide {
width: 400px;
}
.text {
width: 45%!important;
float: right!important;
right: 14px!important;
/* top: 10px!important; */
margin-right: 35px!important;
/* margin-top: 20px!important; */
}
.carousel-inner {
overflow: visible;
}
.carousel img {
border-radius: 0px;
width: 140px;
margin-right: 10px;
margin-left: 80px;
}
.carousel-control active {
position: fixed;
}
.carousel {
margin-top: 40px;
}
.firstcolumn {
width: 1000px;
}
/*.video-container {
/*position:relative;
padding-bottom:315px;
padding-top:10px; /* width: 100% ;* max-width: 500px; padding-right:0px;
/*max-height:530px; overflow: auto;
border: none;
}
.video-container img {
position:absolute;
top:0;
left:0;
width:100%;
max-width: 500px;
max-height:530px;
height:100%;
margin: 0px;*/
/*}*/
</style>
<div class="firstcolumn">
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"> <!-- DIV 1 BEGIN -->
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="false">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img class="image" src="https://www.evantage-technology.com/wp-content/uploads/2015/04/product_office365.jpg" alt="Los Angeles">
<div class="text">Office 365 is the brand name Microsoft uses for a group of subscriptions that provide productivity software and related services.</div>
</div>
<div class="item">
<img class="image" src="http://office365.ecolearning.eu/img/office_icos/delve-logo.png" alt="Chicago">
<div class="text">Microsoft Office Delve is a data visualization and discovery tool that incorporates elements of social networking and machine learning with the search capability of the Microsoft Office 365 suite.</div>
</div>
<!-- <div class="item">
<img src="ny.jpg" alt="New York">
</div>
</div> -->
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev" style="margin-top: 50px">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next" style="margin-top: 50px">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div> <!-- DIV 1 END -->
<div class="secondcolumn">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<center><h3>WHAT DO YOU WANT TO DO?</h3></center>
<br/>
<div class="row">
<div class="col-sm-6" align="center">.col-sm-3</div>
<div class="col-sm-6" align="center">.col-sm-6</div>
</div>
<div class="row">
<div class="col-sm-6" align="center">.col-sm-3</div>
<div class="col-sm-6" align="center">.col-sm-6</div>
</div>
</div>
</div>
</div>
</div>
If you make use of the Bootstrap Grid inside your Carousel component you can avoid using any customized CSS. You just need to structure your HTML accordingly:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-md-6">
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="false">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<div class="row">
<div class="col-xs-4"><img class="img-responsive" src="https://www.evantage-technology.com/wp-content/uploads/2015/04/product_office365.jpg" alt="Los Angeles"></div>
<div class="col-xs-8">Office 365 is the brand name Microsoft uses for a group of subscriptions that provide productivity software and related services.</div>
</div>
</div>
<div class="item">
<div class="row">
<div class="col-xs-2"><img class="img-responsive" src="http://office365.ecolearning.eu/img/office_icos/delve-logo.png" alt="Chicago"></div>
<div class="col-xs-10">Microsoft Office Delve is a data visualization and discovery tool that incorporates elements of social networking and machine learning with the search capability of the Microsoft Office 365 suite.</div>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span><span class="sr-only">Previous</span></a>
<a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span><span class="sr-only">Next</span></a>
</div>
</div>
<div class="col-xs-12 col-md-6">
<h3 class="text-center">WHAT DO YOU WANT TO DO?</h3>
<div class="row">
<div class="col-sm-6 text-center">A</div>
<div class="col-sm-6 text-center">B</div>
</div>
<div class="row">
<div class="col-sm-6 text-center">C</div>
<div class="col-sm-6 text-center">D</div>
</div>
</div>
</div>
</div>
You may need to expand the snippet to view its responsive nature. I would also point out that you were using elements like <center> which were depreciated, or attributes like align="center" on your <div> elements. You should use CSS for this sort of positioning, which with respect to Bootstrap would involve applying the text-center class to the element whose contents you wish to be centered.
I'm developing e-commerce site it is a college project, on that site I have filters and list of products. It works fine on laptop but when I open it on mobile, then the cards of product list comes under the filter. But I want to make it responsive and both columns should increase and decrease their size respective to screen size. I'm new in web-designing, please help me.
The class m is an empty class, i have just used it because with using it it gives nice look to all the contents.
#media screen and (max-width: 480px) {
section.slider {
padding-top: 0%;
}
.mini-menu .sub>ul {
height: 0;
overflow: hidden;
background: #fff;
}
.mini-menu .sub>ul>li>a {
font-family: sans-serif;
color: #FEFEFE;
font-size: 12px;
display: block;
text-decoration: none;
padding: .7em 1em;
text-transform: capitalize;
font-style: normal;
letter-spacing: 1px;
}
.cards {
background: #fff;
border-radius: 2px;
display: inline-block;
height: 50%;
margin: 1rem;
width: 97%;
position: relative;
text-align: center;
}
<div class="m">
<div class="col-md-2">
<div class="menu">
<div class="mini-menu">
<ul>
<li class="sub">
RAM<span style="float:right;"><i class="fa fa-chevron-down"></i></span>
<ul>
<li>
<input class="filter" data-filter=".check1" type="checkbox" id="checkbox1">
<label class="checkbox-label" for="checkbox1" style="color: #212121;">Less than 512 MB</label>
</li>
<li>
<input class="filter" data-filter=".check1" type="checkbox" id="checkbox1">
<label class="checkbox-label" for="checkbox1" style="color: #212121;">512 MB - 1 GB</label>
</li>
</ul>
</li>
<li class="sub">
BRAND<span style="float:right;"><i class="fa fa-chevron-down"></i></span>
<ul>
<li>
<input class="filter" data-filter=".check1" type="checkbox" id="checkbox1">
<label class="checkbox-label" for="checkbox1" style="color: #212121;">HP</label>
</li>
<li>
<input class="filter" data-filter=".check1" type="checkbox" id="checkbox1">
<label class="checkbox-label" for="checkbox1" style="color: #212121;">Dell</label>
</li>
</ul>
</li>
<li class="sub">
CUSTOMER RATINGS<span style="float:right;"><i class="fa fa-chevron-down"></i></span>
<ul>
<li>
<input class="filter" data-filter=".check1" type="checkbox" id="checkbox1">
<label class="checkbox-label" for="checkbox1" style="color: #212121;">4 <i class="fa fa-star"></i> & above</label>
</li>
</ul>
</li>
</ul>
</div>
<div class="menu-price menu-item">
<div class="header-item">Price<span style="float:right;"><i class="fa fa-chevron-down"></i></span></div>
<p>
<input type="text" readonly id="amount" style="border:0; color:#f6931f; font-weight:bold;">
</p>
<div id="slider-range"></div>
</div>
</div>
</div>
<div class="col-md-10">
<div class="cards card4">
<div class="carousel slide" id="myCarousel2" data-ride="carousel" data-interval="000" data-pause="hover">
<div class="carousel-inner">
<div class="item active">
<div class="col-xs-3">
<img src="computers/img/lenovo.png" alt=" " class="img-responsive" />
</div>
</div>
</div>
</div>
<a class="left carousel-control" href="#myCarousel2" data-slide="prev"><i class="glyphicon glyphicon-chevron-left"></i></a>
<a class="right carousel-control" href="#myCarousel2" data-slide="next"><i class="glyphicon glyphicon-chevron-right"></i></a>
</div>
<div class="clearfix"></div>
</div>
<div class="cards card4">
<div class="carousel slide" id="myCarousel" data-ride="carousel" data-interval="000" data-pause="hover">
<div class="carousel-inner">
<div class="item active">
<div class="col-xs-3">
<img src="computers/img/dell.jpeg" alt=" " class="img-responsive" />
<p>
<br> Dell Core i3 6th Gen <br> Rs 29,990 <br>
</p>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
I'm trying to make a bootstrap carousel. However, I'm trying to make one of the slides consist of 3 images that sit next to each other wrapped in a div.
All the other slides in the show are centered and look nice enough, but the slide that consists of 3 img wrapped in a div just keeps floating to the left of the page even though I haven't told them to.
I will include code.
Carousel
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="images/jumbotron.jpg" alt="cd release promo">
</div>
<div class="item">
<img src="images/Coldclock Knockout Local 662 (10).jpg" alt="Robby and Ryan in blue">
</div>
<!-- Div containing 3 images -->
<div id="ryanSlide" class="item">
<div id="ryanSlideContainer">
<img src="images/Coldclock Knockout Local 662 (38).jpg" alt="Ryan 1">
<img src="images/Coldclock Knockout Local 662 (46).jpg" alt="Ryan 2 B&W">
<img src="images/Coldclock Knockout Local 662 (47).jpg" alt="Ryan 3">
</div>
</div>
<div class="item">
<img src="images/Coldclock Knockout Local 662 (48).jpg" alt="Crowd Shot">
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" 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="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
CSS + bootstrap is also being used on this page
body {
background-color: black;
}
/*================================================================================================
NAVIGATION
================================================================================================*/
.active {
border-bottom: 1px solid red;
}
.navbar-inverse .navbar-nav > .active > a{
font-size: 1.25em;
}
#navigation {
margin-bottom: 0px;
border-radius: 0px;
}
/*================================================================================================
JUMBOTRON
================================================================================================*/
#myCarousel img {
height: 500px;
margin: 0 auto;
}
#ryanSlide {
margin: 0 auto;
width: 100%;
}
#ryanSlideContainer {
margin: 0 auto;
}
#ryanSlide img {
margin: 0 auto;
}
/*================================================================================================
================================================================================================*/
I'm not using any custom javascript.
I just cant seem to figure out how to get the one slide to center itself like the others.
You can technically put anything in a carousel, it doesn't need to just be a single image, so you could just use bootstrap columns to do it.
For example:
<div id="ryanSlide" class="item">
<div class="col-md-4">
<img src="" class="img-responsive center-block" alt=""/>
</div>
<div class="col-md-4">
<img src="" class="img-responsive center-block" alt=""/>
</div>
<div class="col-md-4">
<img src="" class="img-responsive center-block" alt=""/>
</div>
</div>