Twitter Bootstrap Scaffolding Issues (Layout) - html

I have several issues laying out a website UI using Twitter's Bootstrap grid.
First off, here is the jsFiddle for my UI mockup.
I've explored the UI layout using Firebug, and things just don't seem correct. I set up a centered div (not using offset*, but actually maintaining centeredness in page regardless of window size by utilizing my centeredDiv class that I defined) which contains all accordion and the white rectangle div where the content will go.
The accordion and the content div are span2 and span8 classes, respectively. So they add up to fill up the space of their parent div, a div of class span10.
The issues are as follows:
The bottom of the background for the accordion and the bottom of the white, content rectangle are not lining up.
The bottom yellow div containing the church information isn't lined up properly with the white content div.
The text within the bottom yellow div isn't centered horizontally. I need it to be.
I really appreciate the help!

JSfiddle for you see it in action
Issue 1 : Accordion background and white background are not lining up because you have set the wrong height for accordion , it has to be height:661px .
Issue2 : It can be resolved by modifying the way you have arranged columns. Use the footer inside the main row and after the content div.
<!--Menu and Content-->
<div class="row" id="rowEntirePage">
<div class="span10 centeredDiv" id="divContentStage">
<div class="row" id="rowContentStage">
<!--Menu-->
<div class="span2 accordion" id="menuAccordion">
<!--MINISTRIES-->
<div class="accordion-group">
<div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2"
href="#collapseOne"> MINISTRIES </a> </div>
<div id="collapseOne" class="accordion-body collapse in">
<div class="accordion-inner">
<ul class="nav nav-pills nav-stacked">
<li class="active">WORSHIP </li>
<li>CHILDREN </li>
<li>YOUTH </li>
<li>WOMEN </li>
<li>DISCIPLESHIP </li>
<li>MEDIA/TECH </li>
</ul>
</div>
</div>
</div>
<!--About Us -->
<div class="accordion-group">
<div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2"
href="#collapseTwo"> ABOUT US </a> </div>
</div>
<!--THE TEAM -->
<div class="accordion-group">
<div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2"
href="#collapseTwo"> THE TEAM </a> </div>
</div>
<!--EVENTS -->
<div class="accordion-group">
<div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2"
href="#collapseTwo"> EVENTS </a> </div>
</div>
<!--SMALL GROUPS-->
<div class="accordion-group">
<div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2"
href="#collapseTwo"> SMALL GROUPS </a> </div>
</div>
<!--MEDIA CENTER-->
<div class="accordion-group">
<div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2"
href="#collapseTwo"> MEDIA CENTER </a> </div>
</div>
<!--BLOG -->
<div class="accordion-group">
<div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2"
href="#collapseTwo"> BLOG </a> </div>
</div>
</div>
<!--Content-->
<div class="span8" id="divContent"></div>
<!--Contact Info-->
<div id="rowContactInfo" class="span8">
<div id="divContactInfo">
<p id="paragraphContactInfo">Church Name / Address / Town, State Zip Code Phone # / <a>Email Us</a> <br>
<a>Maps& Directions</a> </p>
</div>
</div>
</div>
And specifying the following property to the contact div :
#rowContactInfo {
background: linear-gradient(#F4D987, #FFFFFF) repeat scroll 0 0 transparent;
color: #FF0000;
height: 75px;
margin: 0;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
vertical-align: top;
}
Issue 3 : I dont see any issue there . can you show me a picture of how you want it .
Update: Issue 3 : Please write styles and format your footer list properly . As in current representation it is mere text .
Hint : If anything doesnt align when you resize , its probably because you have to write media queries for your custom styles the following way for different resolution :
#media (min-width: 768px) and (max-width: 979px) {
}
#media (max-width: 767px) {
}
#media (max-width: 480px) {
}
Just put your custom styles for a particular section that doesnt look good in the required resolution

Related

Getting the accordion to take full height and each individual panes to take the full viewport height. (Bootstrap 4)

https://i.stack.imgur.com/LqhXn.png This doesn't belong to me but its clear to explain what I want to achieve.
Below is my current code
<div class="accordion" id="myAccordion">
<div class="card">
<div class="card-header" id="section1" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<h2 class="mb-0">
<i class="fa fa-search" aria-hidden="true"></i> Section 1
</h2>
</div>
<div id="collapseOne" class="collapse" aria-labelledby="section1" data-parent="#myAccordion">
<div class="card-body">
Some content here
</div>
</div>
</div>
<div class="card">
<div class="card-header" id="section2" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
<h2 class="mb-0">
<i class="fa fa-briefcase" aria-hidden="true"></i> Section 2
</h2>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="section2" data-parent="#myAccordion">
<div class="card-body">
some other content here
</div>
</div>
</div>
</div>
</div>
</div>
I've look at some similar questions asked and none has helped by far. I need the the card-body of section1 to take full height based on the user's viewpoint despite the amount of content inside the card-body, and push section2's card-header all the way to the bottom of the accordion. Any help or further reference is appreciated.
[This is what the result I have now ->] https://i.stack.imgur.com/THCb9.png
The basic idea is to set the accordion height to 100% viewport height, display the accordion as flexbox in column direction, and grow the opened section (using flex-grow:1;) so that it will take up the remaining space vertically.
This way you don't have to hard code any number for heights.
It would have been PURE CSS if Bootstrap has the ability to extend the collapse plugin so that I can add any CSS class to the parent who has a collapsible child. Currently when you click on the header, the collapsible section opens and the .show class is only added to that collapsible section, not its parent .card.
To identity which .card is open we need the following JavaScript utilizing Bootstrap Collapse Events:
$(function() {
$('.accordion-vh-100 .collapse').on('show.bs.collapse', function () {
$(this).parents('.card').addClass('show');
});
$('.accordion-vh-100 .collapse').on('hide.bs.collapse', function () {
$(this).parents('.card').removeClass('show');
});
});
Here when we toggle the collapsible, I add/remove a CSS class .show on its parent .card.
Now we know which .card is opened when its collasible child is opened. We can start writing CSSs to make the accordion take up 100% viewport height.
First, I would like to introduce a separate CSS class for this 100% viewport height feature. Let's call it .accordion-vh-100. Another change I made was to change the .card-header from a div to an anchor tag so that the entire .card-header is clickable:
<div class="accordion accordion-vh-100" id="myAccordion">
<div class="card">
<a class="card-header" href="#collapseOne" data-toggle="collapse">
<h2 class="mb-0">Section 1</h2>
</a>
<div id="collapseOne" class="collapse" data-parent="#myAccordion">
<div class="card-body">...</div>
</div>
</div>
...
</div>
Next, we need to style the new .accordion-vh-100 to take up 100% viewport height, as well as to display as a flexbox with a column flow direction:
.accordion-vh-100 {
height: 100vh;
display: flex;
flex-flow: column nowrap;
}
Lastly, we need to grow the opened .card:
.accordion-vh-100 .card.show {
flex-grow: 1;
}
demo: https://jsfiddle.net/davidliang2008/b1duyLs8/24/
Check out this snippet:
<div class="accordion" id="myAccordion">
<div class="card">
<div class="card-header" id="section1" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<h2 class="mb-0">
<i class="fa fa-search" aria-hidden="true"></i> Section 1
</h2>
</div>
<div id="collapseOne" class="collapse" aria-labelledby="section1" data-parent="#myAccordion">
<div class="card-body" style="height: 85vh;">
Some content here
</div>
</div>
</div>
<div class="card">
<div class="card-header" id="section2" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
<h2 class="mb-0">
<i class="fa fa-briefcase" aria-hidden="true"></i> Section 2
</h2>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="section2" data-parent="#myAccordion">
<div class="card-body" style="height: 85vh;">
some other content here
</div>
</div>
</div>
</div>
Here we applied style="height: 85vh;" on <div class="card-body"> to increase it height up-to 85% of view-port height.
If you going to add more cards, you will need to decrease this height, to display other card headers when one of the card expanded.

How can I simply place a button on the top right of the page?

My main goal is to create a btn that play/pause the song on my wedding site.
I got it to work on the desktop view port, but not on the phone.
Notice the play btn on the far right, when clicking on it, it will play the song, the icon will toggle to pause, like this
So far so good, everything work perfectly fine.
Here come the issue, here what it look like on the 400px
I see it, but, they're not clickable at all.
I tried to inspect it, this is what I see.
I was thinking that I had the issue with z-index, I've tried to give one to my btn, but it still doesn't work.
I'm a little stuck now, please feel free to give me any suggestions.
HTML
<!--Header start -->
<header>
<!--menu start-->
<div class="menu">
<div class="navbar-wrapper" id="navbar">
{{-- Music --}} -------------------------------------------------
<div class="pull-right btn-music">
<a class="pause_audio_btn hidden"><i class="fa fa-pause"></i></a>
<a class="play_audio_btn"><i class="fa fa-play"></i></a>
</div>
{{-- Music --}} -------------------------------------------------
<div class="container">
<!--Logo -->
<div class="logo">
<img id="logo" src="/img/love/logo_pink.png" alt="Roth-Long-Wedding">
</div>
<div class="logo_phone hidden">
<img src="/img/love/logo_pink.png" alt="Roth-Long-Wedding">
</div>
<div class="navwrapper">
<div class="navbar navbar-inverse navbar-static-top">
<div class="container">
<div class="navArea">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav" id="navigation">
<li class="menuItem" id="home">Home</li>
<li class="menuItem">Count Down</li>
<li class="menuItem">Couple</li>
<li class="menuItem">Events</li>
<li class="menuItem">Gallery</li>
<li class="menuItem">Accommodation</li>
<li class="menuItem">RSVP</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- End Navbar -->
</div>
</div>
</div>
<!--menu end-->
<!--video header start-->
<div class="banner row" id="banner">
<div class="col-xs-12 col-sm-6 col-md-12 col-lg-12 noPadd slides-container" style="height:100%">
<!--background slide show start-->
<div class="slide into_firefly">
<!--header text1 start-->
<div class="container hedaer-inner ">
<div class=" bannerText clearfix ">
<h1>Long & Roth</h1>
<h4>WE ARE GETTING MARRIED</h4>
<p class="ruler"><span></span>
<a class="pause_audio_btn hidden"><i class="fa fa-pause"></i></a>
<a class="play_audio_btn"><i class="fa fa-play"></i></a>
<span></span></p>
<h4 class="date long">July 26th, 2016</h4>
<h4 class="date short">-07.26.2016-</h4>
</div>
<p class="downArrow"><i class="fa fa-chevron-down"></i></p>
</div>
<!--header text end-->
<img src="/img/love/main/edit/retina.jpg" alt="Main Image">
</div>
<!--background slide show end-->
</div>
</div>
<!--banner end-->
</header>
<!--Header end -->
Remove the part where you have set the logo to z-index: 9999
Then add this to your css
.navbar-header button{
float:right;
}
It is a z-index issue, but z-index is tricky and only works when the elements have a position other than static (which is default).
{{-- Music --}} -------------------------------------------------
<div class="pull-right btn-music" style="position:relative; z-index:99">
...
</div>
{{-- Music --}} -------------------------------------------------
<div class="container" style="position:relative; z-index:98">
...
</div>
(I put the styling inline for clarity)
There are likely other way to fix this, but this was the quickest.
Pull the button outside of .navbar-wrapper and put it as the first element under .menu
That'll work :)

Legacy Bootstrap Span Issue

I am working with a legacy bootstrap tool for my company. An issue I am having is using panels from bootstrap 3 in the legacy version.
While this is working to an extent, there are some span issues that are coming up.
I have a container with a panel on the page which is inside of a span12 (full length of the page). Within the panel, I am trying to add another panel that is full width of it. Normally I would say, span12 and it would adjust it to what is necessary but in this case, its causing it to hang over.
Here is a sample of the HTML being used:
<div id="main" class="container">
<div class="panel panel-primary custom-panel">
<div class="panel-heading ph"> <span class="panel-title"><i class="icon-bullhorn"></i> Request Communication</span><button name="addComment" commenttype="request" type="button" class="btn btn-mini pull-right"><i class="icon-plus"></i> Add Comment</button></div>
<div class="panel-body well">
<div id="requestComments" class="tab-pane active">
<span name="messages">
<div name="parent_32" class="row parentMessage">
<div class="span12">
<div class="panel panel-default">
<div class="panel-heading">
<small><a target="_BLANK" href="#">Name</a> <span class="text-muted">commented <a title="Timestamp: 2015-08-24 11:20 UTC" data-toggle="tooltip" class="deco-none">2 days ago</a></span></small>
<div class="btn-group pull-right">
<button aria-expanded="false" aria-haspopup="true" data-toggle="dropdown" class="btn btn-default btn-mini dropdown-toggle" type="button"><i class="icon-cog"></i></button>
<ul class="dropdown-menu">
<li><a messageid="32" name="deleteParent"><i class="icon-trash"></i> Delete Message</a></li>
</ul>
</div>
</div>
<div class="panel-body"><small>dgdfgdfg</small></div>
</div>
</div>
</div>
</span>
</div>
</div>
</div>
</div>
Fiddle: http://jsfiddle.net/j2j6gnb1/
How can I go about making the inner panel, the full width of its parent (with the same padding it has on the left)?
Remove the margins being set on elements .parentMessage and .span and set width: 100% on the .span12 element.
.parentMessage {
margin: 0;
}
.span12 {
width: 100%;
margin: 0;
}
Fiddle

Add accordion functionality to bootstrap linked list

I'm having a hard time with this. I'm trying to make it so when you click on a bootstrap linked-list item it expands to show additional text in an accordion fashion.
This is my code: http://www.bootply.com/6zXrStZ2o3
<div class="container">
<h1>Bootstrap 3 List Groups</h1>
<div class="list-group">
<a href="#" class="list-group-item">
Linked item in .list-group
</a>
<a href="#" class="list-group-item">Linked item in .list-group with Chevron and Badge
</a>
</div>
</div>
How can I make it so when I click on the title of one of the linked lists it expands to show more content?
Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element
<div class="container">
<h1>Bootstrap 3 List Groups</h1>
<div class="list-group">
<a href="#" class="list-group-item" data-toggle="collapse" data-target="#info1">
Linked item in .list-group
<div id="info1" class="collapse">More Info #1</div>
</a>
<a href="#" class="list-group-item" data-toggle="collapse" data-target="#info2">Linked item in .list-group with Chevron and Badge
<div id="info2" class="collapse">More Info #2</div>
</a>
</div>
</div>

Bootstrap with navbar fixed top and Bootstro

I am using Bootstrap + Bootstro but can't make the top navbar to get behind the overlay.
http://jsfiddle.net/NJsYw/5/ (click on Tutorial)
<div id="wrap">
<!-- Fixed navbar -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="#">Project name</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li><a href="#" id='tutorial'>Tutorial</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<!-- Begin page content -->
<div class="container">
<div class="page-header">
</div>
<p class="lead bootstro" data-bootstro-title='Title' data-bootstro-content="Description." data-bootstro-width="400px" data-bootstro-placement='bottom' data-bootstro-step='0'>Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS. A fixed navbar has been added within <code>#wrap</code> with <code>padding-top: 60px;</code> on the <code>.container</code>.</p>
<p class="bootstro" data-bootstro-title='Title' data-bootstro-content="Description." data-bootstro-width="400px" data-bootstro-placement='bottom' data-bootstro-step='1'>Back to the sticky footer minus the navbar.</p>
</div>
<div id="push"></div>
</div>
<div id="footer">
<div class="container">
<p class="muted credit">Example courtesy Martin Bean and Ryan Fait.</p>
</div>
</div>
Looks like this was address here https://github.com/clu3/bootstro.js/issues/15 but I didn't know how to apply (if it is necessary)
Thanks
This can be done using CSS the key is z-index which specifies the stack order of an element.
The bootstrap navbar has a z-index of 1030 so in order for the bootstro backdrop to cover the navbar you need to adjust the z-index to be higher than 1030.
e.g.
.bootstro-backdrop
{
....
z-index: 2000;
}
You also need to make sure that the bootstrap popover is not covered so you need to increase its z-index to be higher than 2000.
.popover {
z-index:2001;
}
FIDDLE