How to set tabs according specific grids in bootstrap? - html

I'll be glad if you can help me on a specific issue for which I haven't find
any solution for that.
I have to make a web page in bootstrap which includes horizontal tabs.
The issue is that I need that The first tab will start from the
2nd grid and beyond as seen below:
I tried with my code but nothing works as expected in the image above:
.nav-tabs-colors {
background-color: #ececef;
}
.edit-app-tabs {
background-color:#ececef;
}
#edit-app-tab {
background-color:#ececef;
}
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<div class="tabbable edit-app-tabs">
<ul class="nav nav-tabs nav-tabs-colors">
<div class="col-lg-offset-1"><li role="presentation"></li></div>
<li role="presentation">Tab1</li>
<li role="presentation" class="active">Tab2</li>
<li role="presentation">Tab3</li>
<li role="presentation">Tab4</li>
<li role="presentation">Tab5</li>
<li role="presentation">Tab6</li>
<li role="presentation">Tab7</li>
<li role="presentation">Tab8</li>
</ul>
<div class="tab-content">
<div id="edit-app-tab" class="tab-pane fade in active">
<div class="row">
<h3>Content Content Content</h3>
</div>
</div>
</div>
<div>
Can you please show me how to exact fit the tabs according to specific grid ?
Thanks in Advance for your help!
EVH671

You could for instance put your tabs into a divider with col-md-offset-1 class
.nav-tabs-colors {
background-color: #ececef;
}
.edit-app-tabs {
background-color: #ececef;
}
#edit-app-tab {
background-color: #ececef;
}
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div class="tabbable edit-app-tabs">
<ul class="nav nav-tabs nav-tabs-colors col-md-offset-1">
<div class="">
<li role="presentation"></li>
</div>
<li role="presentation">Tab1
</li>
<li role="presentation" class="active">Tab2
</li>
<li role="presentation">Tab3
</li>
<li role="presentation">Tab4
</li>
<li role="presentation">Tab5
</li>
<li role="presentation">Tab6
</li>
<li role="presentation">Tab7
</li>
<li role="presentation">Tab8
</li>
</ul>
<div class="tab-content">
<div id="edit-app-tab" class="tab-pane fade in active">
<div class="row">
<h3>Content Content Content</h3>
</div>
</div>
</div>
<div>
More on grids: http://getbootstrap.com/css/#grid
Bare in mind that this offset's the div by 1 column in medum viewport and up.
and it'd be wise to have your whole layout structured properly with containers, rows and columns.

Related

Nav tabs with if statments

I have bootstrap nav taps working with if statements to dynamically fill content. What I am trying to accomplish is have the tabs fade state switched to active (expanded) if the if condition is meet. Right now "Green" shows active and I can click the other tabs just fine to expose the content. So if Green has no content, show Red, if Red has no content show Yellow. This would all be on first page visit with the content expanded.
There will always be content in Yellow, Orange and Blue.
I am struggling with how to best approach this? Any hints would be appreciated.
Sorry don't know how to include if statements with jfiddle. jfiddle
<ul id="tabs" class="nav nav-tabs nav-fill">
{ if green }
<li class="active nav-item"><a data-toggle="tab" href="#1">Green</a></li>
{ endif }
{ if red }
<li class="nav-item"><a data-toggle="tab" href="#2">Red</a></li>
{ endif }
<li class="nav-item"><a data-toggle="tab" href="#3">Yellow</a></li>
<li class="nav-item"><a data-toggle="tab" href="#4">Orange</a></li>
<li class="nav-item"><a data-toggle="tab" href="#5">Blue</a></li>
</ul>
<div class="tab-content">
<div id="color-featured" class="tab-pane active">
<div class="color-tab-item">
{ if green }
<div>{green}</div>
{ endif }
</div>
</div>
<div id="2" class="tab-pane fade">
{ if red }
<div class="red"> {red}</div>
{ endif }
</div>
<div id="3" class="tab-pane fade">
<div class="yellow"> {yellow}</div>
</div>
<div id="4" class="tab-pane fade">
{orange}
</div>
<div id="5" class="tab-pane fade">
{blue}
</div>
</div>

I don't know why my footer is not 100% wide with bootstrap 4.0

My footer is not getting 100% wide and i really don't know what is wrong. Maybe there's a problem with container nesting, but i don't know how to fix it properly. I've just started learning Bootstrap, so this is my first code with it.
<div class="container-fluid d-flex align-items-center justify-content-around">
<footer class="container-fluid align-items-center text-center">
<div class="row">
<div class="col-4">
<ul class="list-unstyled">
<li class="mb-2 font-weight-bolder">Links</li>
<li class="mb-2"><a class="text-reset" href="#">Home</a></li>
<li class="mb-2"><a class="text-reset" href="#">Cardápio</a></li>
<li class="mb-2"><a class="text-reset" href="#">Contato</a></li>
</ul>
</div>
<div class="col-8">
<ul class="list-unstyled">
<li class="mb-2 font-weight-bolder">Pizzas</li>
<li class="mb-2"><a class="text-reset" href="#">Tradicionais</a></li>
<li class="mb-2"><a class="text-reset" href="#">Nobres</a></li>
<li class="mb-2"><a class="text-reset" href="#">Doces</a></li>
</ul>
</div>
</div>
<p class="align-items-center">Pizzaria.com.br</p>
</footer>
</div>
Here is the website print
Any suggestions?
You can try this in your .css file
body{
margin:0;
padding:0;
}

image not looking good in firefox as it looks in chrome

I am having the problem which is the image on my chrome is looking perfectly fine as it is shown in the screenshot given below but in firefox it is not looking fine as it looks like in chrome
This is how it looks in Firefox.
And this is how it looks in Chrome.
HTML
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> -->
<div class="desti-tab-row col col-sm-12 no-padding">
<ul class="nav nav-tabs">
<li class="nav-item"><a class="nav-link active safetyandsecurity" data-toggle="tab"
href="#safetyandsecurity">SAFETY AND SECURITY
</a></li>
<li class="nav-item"><a class="nav-link comfortandconvenience" data-toggle="tab"
href="#comfortandconvenience">COMFORT AND CONVENIENCE
</a></li>
<li class="nav-item"><a class="nav-link environmental" data-toggle="tab" href="#environmental">ENVIRONMENTAL</a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane container active" id="safetyandsecurity">
<div class="row">
<div class="content-info col col-sm-6 no-l-padding">
<h3 class="red-title">SAFETY AND SECURITY</h3>
<div class="container">
<div class="row">
<div class="col-sm-6">
<ul>
<li class="list-item"><img class="sec_cam"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/sec-cam.png">
<span>24HR CCTV MONITORING</span>
</li>
<li class="list-item"><img class="cctv"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/cctv.png">
<span>CCTV CONTROL ROOM</span>
</li>
<li class="list-item"><img class="sec_personnel"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/sec-personnel.png">
<span>SECURITY PERSONNEL ON-DUTY AROUND THE CLOCK</span>
</li>
<li class="list-item"><img class="entry_exit"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/entry_exit.png">
<span>ENTRY AND EXIT CONTROLLED BY ACCESS CARD SYSTEM</span>
</li>
<li class="list-item"><img class="heigtened_rail"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/heightened-railings.png">
<span>HEIGHTENED RAILINGS</span>
</li>
</div>
<div class="col-sm-6">
<li class="list-item"><img class="window_opening"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/windows-opening.png">
<span>RESTRICTED WINDOW OPENING SPACE</span>
</li>
<li class="list-item"><img class="fire_doors"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/fire-dors.png">
<span>FIRE RATED DOORS</span>
</li>
<li class="list-item"><img class="fire_access"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/fire-access.png">
<span>FIRE RATED ACCESS CONTROL PANELS</span>
</li>
<li class="list-item"><img class="fire_furniture"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/fire-furniitiure.png">
<span>FIRE RATED FURNITURE</span></li>
<li class="list-item"><img class="wifi"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/wifi.png">
<span>SECURE ISOLATED NETWORKS FOR WI-FI AND CCTV</span>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane container fade" id="comfortandconvenience">
<div class="row">
<div class="content-info col col-sm-6 no-l-padding">
<h3 class="red-title">COMFORT AND CONVENIENCE</h3>
<div class="container">
<div class="row">
<div class="col-sm-6">
<ul>
<li class="list-item"><img class="male_female"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/male_female.png">
<span>DEDICATED BLOCKS FOR MALE AND FEMALE RESIDENTS</span>
</li>
<li class="list-item"><img class="sound"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/sound.png">
<span>NOISE REDUCING WALLS AND DOORS (STC RATED)</span>
</li>
<li class="list-item"><img class="room"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/room.png">
<span>DEDICATED ACCESS POINTS FOR EACH ROOM</span>
</li>
<li class="list-item"><img class="internet"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/internet.png">
<span>HIGH SPEED INTERNET</span>
<li class="list-item"><img class="sweeper"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/sweeper.png">
<span>FULL-TIME SANITARY AND HOUSEKEEPING SERVICES</span></li>
</div>
<div class="col-sm-6">
</li>
<li class="list-item"><img class="digital_notice"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/digital_notice.png">
<span>DIGITAL NOTICE BOARDS ACROSS THE PROPERTY</span>
</li>
<li class="list-item"><img class="residence"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/residence.png">
<span>ON-SITE
RESIDENT SUPPORT – COMMUNITY MANAGEMENT</span>
</li>
<li class="list-item"><img class="water_proof"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/waterproof.png">
<span>WATERPROOF, ANTIFUNGAL AND ANTIBACTERIAL COMFORT SPRING MATTRESSES</span>
</li>
<li class="list-item"><img class="myriad_app"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/myriad_app.png">
<span>THE MYRIAD APP – TO CENTRALISE ADMINISTRATION AND SERVICES SUCH AS BOOKINGS,
PAYMENTS AND NOTICES</span>
</li>
<li class="list-item"><img class="phone"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/phone.png">
<span>IN-ROOM PHONES</span>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane container fade" id="environmental">
<div class="row">
<div class="content-info col col-sm-6 no-l-padding">
<h3 class="red-title">ENVIRONMENTAL</h3>
<div class="container">
<div class="row">
<div class="col-sm-6">
<ul>
<li class="list-item"><img class="heat"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/heat.png">
<span>UV RATED WALLS – HEAT TRANSMISSION REDUCTION</span>
</li>
<li class="list-item"><img class="air_window"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/air_window.png">
<span>DOUBLE GLAZED WINDOWS – COOL AIR CONTAINMENT</span>
</li>
<li class="list-item"><img class="low_energy"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/low_energy.png">
<span>LOW ENERGY CONSUMING HEAT PUMPS</span></li>
</div>
<div class="col-sm-6">
<li class="list-item"><img class="solar_panel"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/solar_panel.png">
<span>SOLAR PANELS SPACE</span>
</li>
<li class="list-item"><img class="sensor"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/sensor.png">
<span>OCCUPANCY SENSORS TO CONTROL LIGHTING AND AC – BOTH IN - ROOM AND THROUGHOUT
COMMON AREAS</span>
</li>
<li class="list-item"><img class="shower"
src="http://dubai.themyriad.com/wp-content/uploads/2020/02/shower.png">
<span>WATER CONSERVING SHOWERHEADS</span></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- Tab end row -->
</div>
CSS
.list-item {
margin-bottom: 20px;
}
.list-item img {
margin-right: 10px;
}
li.list-item {
display: flex;
margin-bottom: 25px;
align-items: center;
}
li img {
margin-right: 21px;
}
li {
display: list-item;
text-align: -webkit-match-parent;
}
How can i correct the images in Firefox?
You can use css grid for this.
li.list-item {
display: grid;
align-items: center;
grid-template-columns: min-content 1fr;
}
demo

Making lateral menu take 100% height with 100vh when scrolling down the page

I'm currently stuck, I'm trying to make a div take 100% height with 100vh (position fixed is not an option). It works, but only for the active window, when we scroll, the div stop taking 100% height.
I've searched on the other topics, and I tried min-height : 100vh, also tried put position relative and min-height: 100% on html and body tags, but it doesn't work for me.
Maybe I have to specify that I'm using bootstrap 3.
HTML
<div id="bel-menu" class="col-sm-3 col-md-2 col-lg-2">
<ul id="custom-menu" class="nav nav-pills nav-stacked" role="menu" aria-labelledby="dropdownMenu">
<li role="presentation" class="groupe-icon dropdown-submenu main-menu">
<div class="blue-bar"></div>
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">Groupe</a>
<div class="menu-arrow"></div>
<ul class="dropdown-menu secondary-menu">
<li class="">Groupe</li>
<li class="">Mission</li>
<li class="">Marques et produits</li>
<li class="">Engagements</li>
<li class="">Temps forts</li>
<li class="">Implantations</li>
<li class="">Bel dans le monde</li>
<li class="">Finance</li>
<li class="">Gouvernance</li>
<li class="">Présenter Bel</li>
</ul>
</li>
<li class="workplace-icon dropdown-submenu main-menu">
<div class="blue-bar"></div>
Workplace
<div class="menu-arrow"></div>
</li>
<li class="documents-icon dropdown-submenu main-menu">
<div class="blue-bar"></div>
Documents
<div class="menu-arrow"></div>
</li>
<li class="moi-chez-bel-icon dropdown-submenu main-menu">
<div class="blue-bar"></div>
Moi chez Bel
<div class="menu-arrow"></div>
</li>
<li class="applications-icon dropdown-submenu main-menu">
<div class="blue-bar"></div>
Applications
<div class="menu-arrow"></div>
</li>
</ul>
<div class="col-sm-3 col-md-2 col-lg-2 nopad open-btn">
<div class="arrow-icon"></div>
</div>
</div>
CSS
#bel-menu {
height: 100vh;
padding: 0;
background-color: #333;
}
Take a look to my project : https://jsfiddle.net/e94wewad/
The div I'm talking about is the one, that is containing the lateral menu.
The menu is taking 100% of the viewport, but when I scroll down, it stops.

Bootstrap: div inside li

I am trying to add divs to the list items of my ul, but this is causing the Twitter Bootstrap framework to behave weirdly. Is this because of something I am doing wrong, or is there a different solution for what I am trying to do?
The code:
<h3>Track listing</h3>
<ul class="list-group">
<li class="list-group-item">
<div class="song-title">1. Song Title</div>
<div class="song-duration">3:50</div>
</li>
<li class="list-group-item">
<div class="song-title">2. Song Title</div>
<div class="song-duration">3:50</div>
</li>
<li class="list-group-item">
<div class="song-title">3. Song Title</div>
<div class="song-duration">3:50</div>
</li>
</ul>
The CSS code:
.song-title {float: left;}
.song-duration {float: right;}
I am using the float attributes in an attempt to make each song's title appear on the left, and the durations on the right. From my (very limited) CSS experience, this should work.
The result:
I have the impression that the list items' sizes are not taking the div sizes in consideration, instead resizing as if they were completely empty.
Any thoughts?
You can clear:both on the li to treat the li as a block level element.
(Add a clearfix on the li)
Track listing
<ul class="list-group">
<li class="list-group-item clearfix">
<div class="song-title">1. Song Title</div>
<div class="song-duration">3:50</div>
</li>
<li class="list-group-item clearfix">
<div class="song-title">2. Song Title</div>
<div class="song-duration">3:50</div>
</li>
<li class="list-group-item clearfix">
<div class="song-title">3. Song Title</div>
<div class="song-duration">3:50</div>
</li>
</ul>
Check this fiddle
It pretty late to answer this question but I thought it will help some-one if they want to try alternative approach to the accepted solution.
I kept the structure in a container and set its max-width property to 100%
<ul class="list-group">
<li class="list-group-item">
<div class="container" style="max-width:100%">
<div class="row">
<div class="col-md-6"></div>
<div class="col-md-6"></div>
</div>
</div>
</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>