I have an accordion which I am placing inside of a carousel, it works fine but I cannot seem to get the position of the header to stay and the footer to be relative(it pushes upwards, rather than opening downward) if anyone has any clue please let me know(text is dummy text and will be replaced so ignore that please) I have tried changing the header position to absolute but it does nothing, and am not seeing anything regarding elemental inheritance that should be causing this, thank you!
Bootstrap Libraries:
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
HTML
<div class="row">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="false">
<!-- 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">
<div class="item active">
<img src="assets/img/a100Logo.png" alt="...">
<div class="carousel-caption">
<p class="headerLightBG">Sample Training Sessions</p>
<p class="textLightBG">
Beginning Front-End Web Development<br />
Introduction to Programming<br />
Intermediate Front-End Web Development: Web Applications<br />
Rapid Prototyping and Iterative Development <br />
Advanced Front-End Web Development: Mobile/Responsive Design <br />
Mobile Application Development: iOS/Android <br />
</p>
</div>
</div>
<div class="item">
<img src="assets/img/a100Logo.png" alt="...">
<div class="carousel-caption">
<p class="headerLightBG">Sample Projects</p>
<p class="textLightBG">
Write a program that successfully interacts with a commercial API.<br />
Create a dynamic front end for an iPhone or Android app.<br />
Design an engaging new web site for a technology company.<br />
Create a database system for matching Apprentices to Companies.<br />
Create a web application that allows consumers to locate fresh produce nearby.<br />
</p> </div>
</div>
<div class="item">
<img src="assets/img/a100Logo.png" alt="...">
<div class="carousel-caption">
<div class="col-lg-6">
<div class= "rightMargin">
<div class="panel-group" id="accordion">
<div class= "panel panel-default">
<a data-toggle="collapse" data-parent="#accordion" href="#FaqCost">
<div class= "panel-heading textLightBG headingColor">
<h4 class="panel-title fatFont">
Does A100 cost me anything?
</h4>
</div>
</a>
<div class="panel-collapse collapse" id="FaqCost">
<div class= "panel-body accText textDarkBG">
No! The program is completely free to Apprentices. This is because A100 is an initiative of Independent Software, with support from Connecticut Innovations and our Partner Companies.
</div>
</div>
</div>
<div class= "panel panel-default">
<a data-toggle="collapse" data-parent="#accordion" href="#FaqTime">
<div class= "panel-heading textLightBG headingColor">
<h4 class="panel-title fatFont">
What kind of time commitment does A100 require?
</h4>
</div>
</a>
<div class="panel-collapse collapse" id="FaqTime">
<div class= "panel-body accText textDarkBG">
The A100 training program requires a commitment of about 10-15 hours per week, including time spent in training sessions. The Program runs 2.5 months and repeats every quarter. Apprentices have been successful in the Program while also maintaining a rigorous academic schedule. A strong work ethic and willingness to learn new things is expected of all Apprentices.
</div>
</div>
</div>
<div class= "panel panel-default">
<a data-toggle="collapse" data-parent="#accordion" href="#FaqSchedule">
<div class= "panel-heading textLightBG headingColor">
<h4 class="panel-title fatFont">
What formal meeting times will I have to attend A100
</h4>
</div>
</a>
<div class="panel-collapse collapse" id="FaqSchedule">
<div class= "panel-body accText textDarkBG">
<p class="textDarkBG topMarginSmall centered">
While the schedule does change quarterly to suit the needs of the current Cohort, here is a sample schedule that Apprentices in the Spring Cohort of 2014 are expected to adhere to.
</P>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class= "leftMargin">
<div class="panel-group" id="accordion2">
<div class= "panel panel-default">
<a data-toggle="collapse" data-parent="#accordion2" href="#FaqFromMe">
<div class= "panel-heading textLightBG headingColor">
<h4 class="panel-title fatFont">
What does A100 want from me?
</h4>
</div>
</a>
<div class="panel-collapse collapse" id="FaqFromMe">
<div class= "panel-body accText textDarkBG">
In exchange for the training and opportunities we afford you to connect with local companies (as well as the free food!), we require that you sign an agreement to seek a paid apprenticeship at one of our Partner Companies in the month after graduating from the Program, and that you work there for at least three months. For more info, please read the full Terms and conditions of the Program.
</div>
</div>
</div>
<div class= "panel panel-default">
<a data-toggle="collapse" data-parent="#accordion2" href="#FaqSkills">
<div class= "panel-heading textLightBG headingColor">
<h4 class="panel-title fatFont">
How much programming experience do I need to apply?
</h4>
</div>
</a>
<div class="panel-collapse collapse" id="FaqSkills">
<div class= "panel-body accText textDarkBG">
Basic programming skills are needed in an object-oriented language of your choice (C++, Java, Python, Scala, Ruby, PHP, etc.), as well as some familiarity with HTML and CSS. Don't worry! We use a programming challenge as part of our application process to make sure everyone begins from a good platform – so you
</div>
</div>
</div>
<div class= "panel panel-default">
<a data-toggle="collapse" data-parent="#accordion2" href="#FaqTeach">
<div class= "panel-heading textLightBG headingColor">
<h4 class="panel-title fatFont">
What will A100 teach me?
</h4>
</div>
</a>
<div class="panel-collapse collapse" id="FaqTeach">
<div class= "panel-body accText textDarkBG">
A100 will teach you how to create working software products as part of a small development team. You'll learn the LAMP stack (Linux-Apache-MySQL-PHP), as well as improve your front end (HTML/CSS/JavaScript) development skills. We'll also expose you to practices used by working developers from the Connecticut tech
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END OF THE ACCORDION-->
</div>
</div>
</div><!-- carousel inner close-->
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div><!-- carousel close-->
</div><!-- row close-->
</div><!-- container close-->
</section>
CSS:
/* Accordion*/
.headingColor:hover
{
-webkit-transition: color 1s;
-moz-transition: color 1s;
-ms-transition: color 1s;
-o-transition: color 1s;
transition: color 1s;
color: #777;
}
.panel-heading a,
.panel-heading a:focus, .headingColor {
text-decoration: none;
color: #006496;
}
.accText
{
Background: #006496;
}
.unstyledList
{
list-style-type: none;
}
.fatFont{
font-weight: 600;
}
This is part of a much larger website, but this is the only section affected, and the accordion looks like it works fine when not placed within the carousel, perhaps that is just an issue of relative movement that the carousel brings to the users attention(I am very new to bootstrap), if so please let me know if this is impossible to fix
thanks!
panel heading and body needed to have overflow hidden tricks done to them
Related
I want to add a carousel from bootstrap to my page, but it really gets me hard time to set it up on every screen, when it looks good on mobile then on big screen it increases image and cuts sides. I don't already know how many different ways I've tired to make it looks right.
<div class="row container-fluid">
<div id="slide" class="col-12 col-md-6">
<div id="carouselExampleIndicators" class="carousel" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="3"></li>
</ol>
<div class="carousel-inner carousel">
<div class="carousel-item active">
<img src="assets/images-car/cat1.png" class="d-block w-100"
alt="a ginger cat sitting on the stairs">
</div>
<div class="carousel-item">
<img src="assets/images-car/cat2.png" class="d-block w-100"
alt="a black-white kitten on young buddha's hands">
</div>
<div class="carousel-item">
<img src="assets/images-car/cat11.png" class="d-block w-100"
alt="a black cat laying on the colorful fabrics">
</div>
<div class="carousel-item">
<img src="assets/images-car/cat4.png" class="d-block w-100"
alt="a white cat with blue eyes covered in colorful fabric">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
#media only screen and (min-width: 768px) {
.carousel {width:75%; height:50vh;}}
I've tried to change display from blok to flex, then I've changed the default bootstrap width on bigger screen to 75% and maybe that wouldn't be a bad result but then I would need to move slides to center of the div but I didn't know how, nothing worked for centering whole carousel. And also when I set up the width for 75% on media screen min-width: 768px, then when I make my windows smaller the carousel gets smaller until the breakpoint for mobile, so I am not sure what media query should I set up for this to look good on every sizes.
Page photo
I have checked my code up and down and cannot find the problem. I do not see any typos or other errors. Can someone please let me know where I went wrong? I just want the tabs at the bottom to be visible and interactive as they should. Any help would be greatly appreciated.
<!-- Main -->
<section id="section">
<div class="container">
<div class="row">
<div class="col-6">
<img src="/mainpic.PNG" alt="Volcano"
class="img-fluid" >
</div>
<div class="div col-6">
<div id="myCarousel" class="carousel slide"
data-ride="carousel">
<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="carousel-item active">
<div class="div container">
<h1>Activity</h1>
<p>Fun DIY activites that will entertain and educate your little ones</p>
</a>
</div>
</div>
<div class="carousel-item">
<div class="div container">
<h1>Activity</h1>
<p>Fun DIY activites that will entertain and educate your little ones</p>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
I'm assum your are using Bootstrap v5.2+. As Bootstrap v5+, data-bs-ride instead of data-ride, On the carouse indicator, data-bs-target instead of data-target. you just change data-target to data-bs-target and data-ride to data-bs-ride to fix it.
you can visit this demo: https://fastbootstrap.com/components/carousel/#with-indicators
I am creating a gallery with albums in Bootstrap 3.3.6. The albums consist of an album cover which reveals or hides the album pics inside a collapsible <div>. Collapsible <div> is also accordion style.
I have 2 layouts for mobile and desktop using media queries and Bootstrap's .hidden-* class. Also, when you click on one of the pics within the album it opens a carousel to scroll through the images.
The code works perfectly, but I would like the collapsible <div> to remain open though the layout changes as the page resizes. Right now it opens on click and then when you resize the screen down past the break point it closes as the layout changes with the breakpoint.
I realize this is a bit unnecessary because basically no one is going to resize their browser this way on a desktop, but I still want to know how to do it. Can't figure it out.
here is a sample of the code, you can see how the layout changes from desktop to mobile.
See it in action here www.leubasketball.com/gallery
<div class="panel-group text-center" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div class="col-sm-12 col-md-12 hidden-xs">
<!--Desktop Gallery------------------------------>
<!--Album Covers--------------------------------->
<!--Skillcase 2016 Album Cover----------------------->
<div class="col-sm-3 panel-heading" role="tab" id="skillcase2016">
<div class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSkillcase2016" aria-expanded="true" aria-controls="collapseSkillcase2016">
<h4 style="color:#ffffff">Skillcase 2016</h4>
<img src="img/completeplayerimage.jpg" class="albumCover img-responsive">
</a>
</div>
</div>
<!--St Goerge 2016 Album Cover----------------------->
<div class="col-sm-3 panel-heading" role="tab" id="stgeorge2016">
<div class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseStgeorge2016" aria-expanded="false" aria-controls="collapseStgeorge2016">
<h4 style="color:#ffffff">St. George 2016</h4>
<img src="img/completeplayerimage.jpg" class="albumCover img-responsive">
</a>
</div>
</div>
</div>
<!--Albums-------------------------------------------->
<!--Skillcase 2016 Album--------------------------->
<div id="collapseSkillcase2016" class="panel-collapse collapse" role="tabpanel" aria-labelledby="skillcase2016">
<div class="panel-body">
<!--Thumbnails-------->
<div class="col-sm-12 col-md-12 hidden-xs">
<!--Carousel Modal here-------------------------------------->
</div>
</div>
</div>
<!--Skillcase 2016 Album--------------------------->
<div id="collapseStgeorge2016" class="panel-collapse collapse" role="tabpanel" aria-labelledby="stgeorge2016">
<div class="panel-body">
<!--Thumbnails-------->
<div class="col-sm-12 col-md-12 hidden-xs">
<!--Carousel Modal here-------------------------------------->
</div>
</div>
</div>
<!--Mobile Gallery---------------------------------------->
<!--Mobile Album Covers-------------------------------->
<!--Skillcase 2016 Album Cover---------------------->
<div class="col-xs-6 visible-xs panel-heading" role="tab" id="skillcase2016M">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSkillcase2016M" aria-expanded="false" aria-controls="collapseSkillcase2016M, collapseSkillcase2016">
<h4 style="color:#ffffff">Skillcase 2016</h4>
<img src="img/completeplayerimage.jpg" class="albumCover img-responsive">
</a>
</h4>
</div>
<!--St. George 2016 Album Cover------------------->
<div class="col-xs-6 visible-xs panel-heading" role="tab" id="stgeorge2016M">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseStgeorge2016M" aria-expanded="false" aria-controls="collapseStgeorge2016M">
<h4 style="color:#ffffff">St. George 2016</h4>
<img src="img/completeplayerimage.jpg" class="albumCover img-responsive">
</a>
</h4>
</div>
<!--Mobile Albums--------------------------------------->
<!--Skillcase 2016 Album---------------------------->
<div id="collapseSkillcase2016M" class="panel-collapse collapse" role="tabpanel" aria-labelledby="skillcase2016M">
<div class="panel-body">
<div class="col-xs-12 hidden-sm hidden-md hidden-lg">
<!--Carousel Modal here------------------------->
</div>
</div>
</div>
<!--St George 2016 Album---------------------------->
<div id="collapseStgeorge2016M" class="panel-collapse collapse" role="tabpanel" aria-labelledby="stgeorge2016M">
<div class="panel-body">
<div class="col-xs-12 hidden-sm hidden-md hidden-lg">
<!--Carousel Modal here------------------------->
</div>
</div>
</div>
</div>
</div>
I wanted my panel heading to contain some text and a button, the former being left-aligned and the latter, right-aligned. But as soon as I apply the class row to my panel header, it breaks out of the parent div and takes up what I believe to be the container width.
Here's the code I'm using:
<div class="panel panel-primary">
<div class="panel-heading row">
<h4 class="col-md-11">Manage Your Subscriptions</h4>
<div>
<a href="#" class="btn btn-default col-md-1" >Log out</a>
</div>
</div>
<div class="panel-body">
</div>
</div>
And here's the result:
How can I correct this?
It seems to me like you just need to move the "row" to be inside the "panel-heading" rather than on the same level, as they both have relative CSS positioning properties. I tried the following code:
<div class="panel panel-primary">
<div class="panel-heading">
<div class="row">
<h4 class="col-md-11">Manage Your Subscriptions</h4>
<div class="col-md-1">
<a href="#" class="btn btn-default" >Log out</a>
</div>
</div>
</div>
<div class="panel-body">
Stackoverflow rocks!
</div>
</div>
and it gave me this output (which is what you're looking for, I hope):
I hope that helps
EDIT: I tried using "pull-right" as others have suggested and it seems to create more troubles as it messes the top/bottom margins as well since it makes the display block relative to container (Which I would generally recommend against doing, even if it works for you).
EDIT2: moved the "col-md-1" class into an encapsulating "div" to solve the button's margins' issue.
May be you need something like following?
<div class="panel panel-primary">
<div class="panel-heading">
<div class="row">
<div class="col-md-10 col-sm-10">
<h4>Manage Your Subscriptions</h4>
</div>
<div class="col-md-2 col-sm-2">
<a href="#" class="btn btn-default pull-right" >Log out</a>
</div>
</div>
</div>
<div class="panel-body">
</div>
</div>
Let me know if it works
You can use pull-left and pull-right instead of grid system, so the components will be rendered on single line even on small screen (if there is enough space):
<div class="panel panel-primary">
<div class="panel-heading">
<h4 class="pull-left">Manage Your Subscriptions</h4>
<span class="pull-right">
<a href="#" class="btn btn-default" >Log out</a>
</span>
<div class="clearfix"> </div>
</div>
<div class="panel-body">
</div>
</div>
I am using Bootstrap 3. I have one row that will hold a variable amount of columns, ranging from 1-let's say 9.
The are currently set to col-lg-4, so three should display on one row. I would normally create a new row, but since I am dynamically adding columns, I cannot do this, or at least do no know how.
When my client adds a post, it automatically creates a column with content.
The problem lies only in Firefox & IE, in both desktop and mobile views. The 4th item (or 1st item that should go to the next row) gets pushed to a new line and is offset. See screenshot below.
I am using ExpressionEngine as my CMS.
It displays perfectly in Chrome.
Code Below
<div class="container">
<div class="row">
{exp:channel:entries channel="plans" orderby="title" sort="asc"}
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 centered">
<div class="grid mask">
<figure>
<img class="img-responsive" src="{plan_main_image}">
<figcaption>
<h5>{title}</h5>
<a data-toggle="modal" href="#{url_title}" class="btn btn-primary btn-lg">View Floor Plan</a>
</figcaption>
</figure>
</div>
</div>
<div class="modal fade" id="{url_title}" tabindex="-1" role="dialog" aria-labelledby="{url_title}" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">{title}</h4>
</div>
<div class="modal-body text-left">
<div class="row">
<div class='list-group gallery'>
<div class="col-lg-4">
<a class="thumbnail fancybox-effects-d" data-fancybox-group="" href="{plan_main_image}">
<img class="img-responsive" alt="" src="{plan_main_image}" />
</a>
</div>
<div class="col-lg-4">
<a class="thumbnail fancybox-effects-d" data-fancybox-group="" href="{plan_first_level}">
<img class="img-responsive" alt="" src="{plan_first_level}" />
</a>
</div>
<div class="col-lg-4">
<a class="thumbnail fancybox-effects-d" data-fancybox-group="" href="{plan_second_level}">
<img class="img-responsive" alt="" src="{plan_second_level}" />
</a>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
{plan_description}
</div>
</div>
<!--<div class="row">
<div class="col-lg-12">
<b>Download the floor plan</b>
</div>
</div>-->
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
{/exp:channel:entries}
</div><!-- /row -->
<br>
<br>
</div><!-- /row -->
</div><!-- /container -->
Thanks
The reason for this is because the first image is slightly taller than the other images. You need to use a responsive column reset for this. See Responsive Column Resets in the doc.
The basic concept is to add a div after the each horizontal grouping that contains a clearfix so that the next horizontal grouping is cleared before and aligns correctly.
For more complex scenarios you can see my answer here: Gap in Bootstrap stacked rows.