Customized Bootstrap Navbar Responsive Problems - html

I have created a vertical navbar that has issues with the toggle feature when becoming a horizontal bar on a mobile device. I've tried to get around it several times, and I've ended up creating a separate style sheet for the mobile version. However, now it interferes with desktop version, and if I try to hide the mobile version, the toggle feature stops working.
I'm sure there must be an easier way to do this, but I haven't found anything that's worked.
HTML
Toggle navigation
KEDEV
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse-ex1-collapse" id="navbar-collapse-ex1-collapse">
<ul class="nav navbar-nav-mobile">
<li>
<img class="icon" src="home.png">
</li>
<li>
<img class="icon" src="services.png">
</li>
<li>
<img class="icon" src="portfolio.png">
</li>
<li>
<img class="icon" src="contact.png">
</li>
</ul>
<ul class="nav navbar-nav social">
<li>
<img class="iconSO" src="twitter.png">
</li>
<li>
<img class="iconSO" src="linkedin.png">
</li>
<li>
<img class="iconSO" src="blogspot.png">
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- End Mobile Nav -->
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-right" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#about">KEDEV</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav">
<li>
<a mouseover="buttonPress('1') class="menu-button" id="aboutButton" data-toggle="tooltip" data-placement="right" title="About" href="#about"><img class="icon" src="home.png"></a>
</li>
<li>
<img class="icon" src="services.png">
</li>
<li>
<img class="icon" src="portfolio.png">
</li>
<li>
<img class="icon" src="contact.png">
</li>
</ul>
<ul class="nav navbar-nav social">
<li>
<img class="iconSO" src="twitter.png">
</li>
<li>
<img class="iconSO" src="linkedin.png">
</li>
<li>
<img class="iconSO" src="blogspot.png">
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
CSS
/* MobileNav*/
.navbar-mobile {
display:none;
}
.mnavbar-header{
display:none;
}
.navbar-fixed-top{
display:none!important;
}
/*Navigation*/
.container {
width:100%;
margin:0 auto;
padding:0;
border-sizing:border-box;
}
.navbar {
margin-bottom:0;
z-index:31;
position:fixed;
float:none;
display:block;
}
.navbar-collapse {
height: 100%;
border-top: 0;
box-shadow: none;
max-height: none;
padding-left:0;
padding-right:0;
float:none;
display:block;
}
.navbar-collapse.collapse {
display: block !important;
width:100%;
overflow: visible !important;
margin-bottom:0px;
}
.navbar-collapse.in {
overflow-x: visible;
}
.navbar-nav,
.navbar-nav > li,
.navbar-left,
.navbar-right,
.navbar-header
{float:none !important;
left:0;right:auto;}
.navbar-collapse .navbar-nav.navbar-right:last-child {
margin-right: 0;
}
.navbar-brand {
color:white;
margin-bottom: 6em;
font-size:2em;
}
.navbar li {
margin: 0.5em 0.5em 0.5em 0.5em ;
position:relative;
}
.icon {
width:2em;
height:2em;
}
.social {
margin-top:20em;
}
.social li {
display:inline-block;
margin: -1em -1.3em -2em -1.1em ;
}
.iconSO {
width:2.3em;
height:2.3em;
}
/* Media Query */
#media (max-width: 767px) {
.navbar {
display:none;
}
.navbar-mobile {
display:block !important;
height:auto;
width:auto;
}
.mnavbar-header{
display:block!important;
overflow:visible;
}
.navbar-fixed-top {
display:block !important;
overflow:visible;
}
.navbar-collapse-ex1-collapse {
background-color: rgba(0, 0, 0, 0.6) !important;
float: left;
margin-top: 0;
margin-bottom: 0;
}
#navbar-collapse-ex1-collapse {
position:fixed;
left:0;
width:100%;
height:100%;
overflow:visible;
display:block ;
}
.nav-collapse.collapse-ex1-collapse {
display: block !important;
height: auto !important;
overflow: hidden !important;
}
.navbar-brand {
margin-bottom:0;
display:block;
}
.navbar li {
font-size:2em;
text-align:center;
display:inline;
}
body {
padding-left: 0;
padding-right: 0;
}
}

Here, This should do the trick.
#media (max-width: 1992px) {
.navbar-header {
float: none;
}
.navbar-left,.navbar-right {
float: none !important;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.navbar-fixed-top {
top: 0;
border-width: 0 0 1px;
}
.navbar-collapse.collapse {
display: none!important;
}
.navbar-nav {
float: none!important;
margin-top: 7.5px;
}
.navbar-nav>li {
float: none;
}
.navbar-nav>li>a {
padding-top: 10px;
padding-bottom: 10px;
}
.collapse.in{
display:block !important;
}
}

Thank you for your suggestions. I have worked with it a few more hours and found an answer.
I deleted quite a bit of my media query CSS and added an overflow:hidden to my .navbar-mobile.
#media (max-width: 767px) {
.navbar-mobile {
display:block !important;
height:auto;
width:auto;
background-color: rgba(0, 0, 0, 0.6) !important;
overflow:hidden;
}
.mnavbar-header{
display:block!important;
}
.navbar-collapse-ex1-collapse {
float: left;
margin-top: 0;
margin-bottom: 0;
}
#navbar-collapse-ex1-collapse {
left:0;
width:100%;
height:100%;
display:block ;
}
.nav-collapse.collapse-ex1-collapse {
display: block !important;
height: auto !important;
}
.collapse.navbar-collapse-ex1-collapse {
background-color: rgba(0, 0, 0, 0,1) !important;
}
.navbar-brand {
margin-bottom:0;
display:block;
}
.navbar li {
font-size:2em;
text-align:center;
display:inline;
}
.navbar-collapse-ex1-collapse {
display:block;
}
}
I'm still working on tweaking the transparency and background, but now the toggle works!

Related

Changing width of Fixed navbar and keeping Collapse element and adding logo/image

i'm trying to change the width of my navbar which is fixed and also has a navbar-collapse property that i want to keep when screen size changes.
I also added in the Bootstrap i am using for this page, so at the moment with the code below, the navbar is fixed but is full width, it collapses when you change to mobile site, so the only thing i want is to change the width from full width so that there is atleast 30% open space on either side of the navbar so it will be centred to the page.
and also adding a logo/image to the navbar only when its collapsed
Hope you can help me!
<html>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<style>
.navbar-nav.nav-justified > li{float:none; }
.navbar{
background-color:white;
font-family: Amatic SC;
border:none;
font-size: 25px;
letter-spacing: 1px;
text-align:center;
}
.navbar:hover,
.navbar:active {
color: black;
transition: background-color 0.3s ease-oin,
color 0.3s ease-out;
}
.navbar-inverse .navbar-nav>li>a:hover {
color: black;
}
#media (max-width: 981px) {
.navbar-left,.navbar-right {
float: none !important;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.navbar-fixed-top {
top: 0%;
border-width: 0 0 1px;
}
.navbar-collapse.collapse {
display: none!important;
}
.navbar-nav {
float: none!important;
margin-top: 7.5px;
}
.navbar-nav>li {
float: none;
}
.navbar-nav>li>a {
padding-top: 10px;
padding-bottom: 10px;
}
.collapse.in{
display:block !important;
}
}
</style>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" "col-xs- col-xs-offset-0 col-md-6 col-md-offset-3" >
<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 class="navbar-collapse collapse" style="text-align:center" >
<ul class="nav navbar-nav nav-justified">
<li id="scrollDetails">Details</li>
<li id="scrollDirections">Directions</li>
<li id="navRsvp">RSVP</li>
<li id="scrollBucket">Bucket List</li>
<li id="scrollAccommodation">Accommodation</li>
</ul>
</div>
</nav>
</body>
</html>
You have to modify the width and centrally align your code in the media queries for the expected behaviour in mobile view.
You have to add the following css:
#media (max-width: 981px) {
.navbar {
width: 30%;
margin: auto;
}
}
Refer code:
.navbar-nav.nav-justified > li {
float: none;
}
.navbar {
background-color: white;
font-family: Amatic SC;
border: none;
font-size: 25px;
letter-spacing: 1px;
text-align: center;
}
.navbar:hover,
.navbar:active {
color: black;
transition: background-color 0.3s ease-oin, color 0.3s ease-out;
}
.navbar-inverse .navbar-nav>li>a:hover {
color: black;
}
#media (max-width: 981px) {
.navbar {
width: 30%;
margin: auto;
}
.navbar-left,
.navbar-right {
float: none !important;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.navbar-fixed-top {
top: 0%;
border-width: 0 0 1px;
}
.navbar-collapse.collapse {
display: none!important;
}
.navbar-nav {
float: none!important;
margin-top: 7.5px;
}
.navbar-nav>li {
float: none;
}
.navbar-nav>li>a {
padding-top: 10px;
padding-bottom: 10px;
}
.collapse.in {
display: block !important;
}
}
<nav class="navbar navbar-inverse navbar-fixed-top col-xs-offset-0 col-md-6 col-md-offset-3">
<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 class="navbar-collapse collapse" style="text-align:center">
<ul class="nav navbar-nav nav-justified">
<li id="scrollDetails">Details
</li>
<li id="scrollDirections">Directions
</li>
<li id="navRsvp">RSVP
</li>
<li id="scrollBucket">Bucket List
</li>
<li id="scrollAccommodation">Accommodation
</li>
</ul>
</div>
</nav>

Nav bar won't center in Bootstrap 3

I'm sorry for asking this question, but I've search through stack overflow for weeks and haven't been able to rectify my problem. My nav bar is left justified; I need it to center. I have tried applying margin: 0px auto; to every element within the hierarchy of the <nav> along with text-align: center; but nothing is centering it.
It's a Bootstrap 3 framework. Here's the code and my external CSS in addition to the bootstrap.min.css file:
.navbar {
margin-bottom: 0;
border-radius: 0;
}
.row.content {
height: 450px
}
.sidenav {
padding-top: 20px;
background-color: #f1f1f1;
height: 100%;
}
footer {
background-color: #555;
color: white;
padding: 15px;
font-family: "IM Fell DW Pica", serif;
font-size: 18px;
}
#media screen and (max-width: 767px) {
.sidenav {
height: auto;
padding: 15px;
}
.row.content {
height: auto;
}
}
#banner-img {
margin: 0px auto;
}
header {
background-color: #394650;
/* background color of header */
}
nav {
font-family: "IM Fell DW Pica", serif;
/* font style of nav bar */
font-size: 23px;
/* font size of nav bar */
}
#myNavBar ul li {
text-align: center;
}
/* FOR SMALL SCREENS */
#media screen and (max-width: 767px) {
nav {
font-size: 40px;
/* changes font size on smaller screens */
}
/* sets dimensions for embedded video on small screens */
#intro-video-div {
height: auto;
width: auto;
}
section h1 {
font-size: 40px;
}
section p {
font-size: 25px;
}
}
/* FOR BIG SCREENS */
#media screen and (min-width: 768px) {
/* sets dimensions for embedded video on larger screens */
#intro-video-div {
width: 560px;
height: 315px;
}
section h1 {
font-size: 36px;
}
section p {
font-size: 20px;
}
#content-ads-holding-div {
height: 750px;
}
.img-responsive {
margin: auto;
}
}
section,
h1,
p {
font-family: "IM Fell DW Pica", serif;
text-align: center;
position: static;
}
#intro-video-div {
margin: 0px auto;
position: static;
text-align: center;
}
#intro-video {
width: 100%;
height: 100%;
}
#nav-div-center,
#nav-ul {
margin: 0px auto;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-inverse">
<div class="container-fluid" id="navbar-container">
<div class="collapse navbar-collapse" id="myNavbar">
<div id="nav-div-center">
<ul class="nav navbar-nav" id="nav-ul">
<li class="active" id="home">Home</li>
<li id="episodes">Episodes</li>
<li id="research">Research</li>
<li id="store">Store</li>
<li id="support">Support</li>
<li id="communicate">Communicate</li>
<li id="affiliations">Affiliations</li>
</ul>
</div>
</div>
</div>
</nav>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
You can see the actual website at http://www.kspavia.com/bootstrap.php
try the below css to make navbar center.
#media (min-width: 768px){
.navbar-nav{
margin: 0 auto;
float: none;
display: table;
}
}
If you want to center the navigation you need to assign a width. A block level element will always expand as wide as it can.
#nav-ul {
max-width: 780px;
}
Depending on what you ultimately want to do (justify the links across the nav or center in the links in the nav) you simple have to change the display and float properties to do either.
Note: I adjusted the font size above 768px to prevent any links from overflowing on a reduced viewport.
Here are two working examples. View at FullPage.
Distributed (justified) Links Example:
.navbar.navbar-inverse {
margin-bottom: 0;
font-family: "IM Fell DW Pica", serif;
font-size: 22px;
}
/*Distributed Links Starts*/
#media (min-width: 768px) {
.navbar.navbar-inverse .navbar-nav {
display: table;
width: 100%;
}
.navbar.navbar-inverse .navbar-nav > li {
display: table-cell;
float: none;
}
.navbar.navbar-inverse .navbar-nav > li > a {
text-align: center;
}
.navbar.navbar-inverse > .container-fluid {
margin-right: 0;
margin-left: 0;
padding-left: 0;
padding-right: 0;
}
}
/*Distributed Links Ends*/
#media screen and (max-width: 767px) {
.navbar.navbar-inverse .navbar-nav > li > a {
font-size: 40px;
padding: 20px 15px;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#myNavbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active" id="home">Home
</li>
<li id="episodes">Episodes
</li>
<li id="research">Research
</li>
<li id="store">Store
</li>
<li id="support">Support
</li>
<li id="communicate">Communicate
</li>
<li id="affiliations">Affiliations
</li>
</ul>
</div>
</div>
</nav>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
Center Links Example:
.navbar.navbar-inverse {
margin-bottom: 0;
font-family: "IM Fell DW Pica", serif;
font-size: 18px;
}
/*Centered Links Starts*/
#media (min-width: 768px) {
.navbar.navbar-inverse .navbar-nav {
width: 100%;
text-align: center;
}
.navbar.navbar-inverse .navbar-nav > li {
display: inline-block;
float: none;
}
}
/*Centered Links Ends*/
#media screen and (max-width: 767px) {
.navbar.navbar-inverse .navbar-nav > li > a {
font-size: 40px;
padding: 20px 15px;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#myNavbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active" id="home">Home
</li>
<li id="episodes">Episodes
</li>
<li id="research">Research
</li>
<li id="store">Store
</li>
<li id="support">Support
</li>
<li id="communicate">Communicate
</li>
<li id="affiliations">Affiliations
</li>
</ul>
</div>
</div>
</nav>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
if you want to make your navigation center aligned. Just update your existing css second-bootstrap-stylesheet.css line no 119 as per below css:-
#nav-div-center, #nav-ul {
width: 78%;
float: none;
}
You can just use .container instead of .container-fluid if you want .navbar block to be on center or use apply styles:
#media (min-width: 768px){
.navbar-nav {
float: none;
text-align: center;
}
.navbar-nav > li {
display: inline-block;
float: none;
}
}

Make responsive image in carousel

I want my image in carousel to become responsive especially the height of the image. The width is okay but the height it makes the image only half. Can someone help me? Give me some ideas please. I just want only 500px of height and I achieved that but i want my image height to become 100%.
Here is the picture
Here is the full image
Here is the html code.
<!DOCTYPE html>
<html>
<head>
<title>Student Portal</title>
<link rel="stylesheet" href ="css/bootstrap.min.css">
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<link href="style.css" rel ="stylesheet">
<link rel="shortcut icon" type="img/png" href="img/asd.png"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class ="top-bar-dark">
<div class="container">
<div class="row">
<div class="col-sm-4 col-xs-7">
<div class="top-bar-socials">
<a href="https://www.facebook.com/pages/Governor-Andres-Pascual-CollegeNavotas-City/344134628983014?fref=ts">
<i class="fa fa-facebook"></i>
</a>
<a href="https://twitter.com/official_gapc">
<i class="fa fa-twitter"></i>
</a>
<a href="https://www.linkedin.com/company/governor-andres-pascual-college-in-navotas-city">
<i class="fa fa-linkedin"></i>
</a>
</div>
</div>
<div class="col-sm-8 col-xs-5 text-right">
<ul class="list-inline top-dark-right">
<li class="hidden-sm hidden-xs"><i class="fa fa-envelope"></i> gapc_school#yahoo.com.ph</li>
<li class="hidden-sm hidden-xs"><i class="fa fa-phone"></i> (02) 282-9036</li>
<li><i class="fa fa-lock"></i> Login</li>
</ul>
</div>
</div>
</div>
</div>
<nav class="navbar navbar-default navbar-static-top" data-spy="affix" data-offset-top="40">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#nav-collapse">
<span class="icon-bar" ></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="img/logo.png" alt="GAPC" class="img-responsive">
</div>
<div class="collapse navbar-collapse" id="nav-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active">Home</li>
<li class="dropdown">
About us
<ul class="dropdown-menu">
<li>History</li>
<li>Mission and Vision</li>
</ul>
<li>Admissions</li>
<li>Contact us</li>
<li>Faculty Portal</li>
</ul>
</div>
</div>
</nav>
<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="img/tae.jpg" alt="Chania">
</div>
<div class="item">
<img src="img/tubol.jpg" alt="Chania ">
</div>
<div class="item">
<img src="img/tulok.jpg" alt="Flower">
</div>
<div class="item">
<img src="img/ebak.jpg" alt="Flower">
</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>
This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.
This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.
This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.
This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.
This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.
This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.
<script src="js/jquery-1.12.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
this is my css code.
.navbar-header{
height: 74px;
}
.navbar-toggle{
position: relative;
top: 15px;
}
.navbar-default .navbar-nav > li > a {
font-weight: 560;
color: #949494;
display: block;
padding: 5px 35px 2px 45px;
border-bottom: 3px solid transparent;
line-height: 70px;
text-decoration: none;
transition: border-bottom-color 0.5s ease-in-out;
-webkit-transition: border-bottom-color 0.5s ease-in-out;
}
.nav.navbar-nav > li > a:hover, .nav.navbar-nav > li.active a{
color:#a92419;
border-bottom-color: #a92419;
}
.navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:focus, .navbar-default .navbar-nav>.active>a:hover {
color: #a92419;
background-color: transparent;
}
.navbar-default{
background-color:#fff;
margin: 0;
}
.nav>li>a {
position: relative;
}
.navbar-default .navbar-right > li > a {
padding: 0 20px;
margin-right:6px;
}
.nav.navbar-nav > li{
display: :inline-block;
}
.nav.navbar-nav{
list-style-type:none;
}
.nav.navbar-nav > li > a:hover{
color:#a92419;
border-bottom-color: #a92419;
}
.navbar-default .navbar-toggle .icon-bar {
background-color:#a92419;
margin:0 0 4px;
width: 25px;
height: 5px;
margin-right: 13px;
}
.navbar-default .navbar-toggle:focus, .navbar-default .navbar-toggle:hover{
background: none;
}
button.navbar-toggle{
background:none;
border:none;
color:#000;
margin: 0px;
}
.navbar.affix {
width: 100%;
qposition: fixed;
top:0;
background-color: rgba(255,255,255,0.7);
}
.dropdown:hover .dropdown-menu {
display: block;
}
.dropdown-menu>li>a:hover {
color:#a92419;
}
.dropdown-menu>li>a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: 400;
line-height: 3em;
color: #333;
white-space: nowrap;
}
.dropdown:hover a.dropdown-toggle {
border-bottom-color: #a92419;
color:#a92419;
}
.top-bar-dark {
background-color: #a92419;
}
.top-bar-light {
background-color: #f3f3f3;
}
.top-bar-light .top-dark-right li {
border-color: #ddd;
}
.top-bar-light .top-dark-right li a:hover {
color: #32c5d2;
}
.top-bar-socials {
line-height: 30px;
padding-top: 5px;
}
.top-bar-socials:after {
display: table;
clear: both;
content: "";
}
.top-bar-socials a {
margin: 0px 8px;
text-decoration: none;
font-size:18px;
color: #fff;
}
.top-dark-right {
margin: 0px;
padding: 0px;
}
.top-dark-right li {
line-height: 40px;
border-left: 1px solid #932015;
padding: 0px 10px;
}
.top-dark-right li, .top-dark-right li a {
color: #d7d7d7;
font-size: 12px;
}
.top-dark-right li i {
margin-right: 5px;
}
.top-dark-right li a:hover {
color: #fff;
}
a.login{
text-decoration: none;
}
.fa-facebook:hover{
color:#3b5998;
}
.fa-twitter:hover{
color:#1dcaff;
}
.fa-linkedin:hover{
color:#007bb5;
}
.carousel-control.left, .carousel-control.right {
background: none !important;
filter: progid: none !important;
outline: 0;
}
.carousel-inner{
height: 500px;
}
.carousel-inner img{
height: auto;
width: 100%;
}
#media (max-width: 240px){
.img-responsive{
padding-top: 5px;
width: 190px;
height: 60px;
}
.navbar-default .navbar-toggle {
padding-right: 0px;
}
}
#media(min-width: 241px) and (max-width: 320px){
.img-responsive{
width: 240px;
height: 60px;
margin-left: 5px;
}
.navbar-default .navbar-toggle {
padding-right: 0px;
}
}
#media(min-width: 321px) and (max-width: 480px){
.img-responsive{
width: 250px;
height: 65px;
margin-left:15px;
}
.navbar-toggle{
padding-top: 10px;
}
}
#media(min-width: 481px) and (max-width: 767px){
.img-responsive{
width: 280px;
height: 70px;
margin-left:15px;
}
.navbar-toggle{
padding-top: 10px;
}
}
#media(min-width: 768px) and (max-width: 1024px){
.img-responsive{
width: 260px;
height:70px;
}
.navbar-default .navbar-right > li > a {
padding: 0 10px;
margin-right:6px;
}
}
Try this
.item.active img {
display: block;
width: 100vw;
height: 100vh;
object-fit: contain;
}
Try 100vh, CSS3 gives us viewport-relative units. 100vw means 100% of the viewport width. 100vh; 100% of the height. Very handy when doing full screen slides.
try this :
.carousel-inner img{
height: 100vh;
width: 100%;
}
Note : for internet explorer it's supported only by ie11, for other browsers there is no problem.
UPDATE :
add this class to your style :
.item{
height: 500px;
}
.item img {
width: 100%;
height: 100%;
}
Here is a Demo : https://jsfiddle.net/qd4xhzvm/
I solved it myself by adding a max-height to .carousel-inner img. Thanks for ur effort guys. hehe.
.carousel-inner img{
width: 100%;
max-height: 500px;
}
.carousel-inner{
height: 500px;
}

side bar position in bootstrap

I have header nav bar and Side nav bar named vertical menu. I couldn't fix the position of my nav bar close to float left. It is having some gaps, I tried adjusting the position still missing something. Please see image for reference
In case if I include another menu now , if I click profile that also kind of not working out, because of the position of the side nav bar.
<title>Bootstrap Case</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<nav class="navbar top-color">
<!--nav header Div-->
<div class="container-fluid">
<div class="col-sm-1"><a class="navbar-head" style="text-decoration:none; color:white;" href="#"><h1>Bootstrap Case</h1></a>
</div>
</div>
</nav>
<nav class="navbar navbar-inverse verticalmenu" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Main Menu</a>
<br><br>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li><span class="glyphicon glyphicon-dashboard vmenu"></span> Dashboard
</li>
<li class="active"><span class="glyphicon glyphicon-user vmenu"></span> Profile
</li>
<li><span class="glyphicon glyphicon-edit vmenu"></span>Skill Test
</li>
<li><span class="glyphicon glyphicon-tags vmenu"></span>Interviews
</li>
<li><span class="glyphicon glyphicon-off vmenu"></span>Logout
</li>
</ul>
</div>a
<!-- /.navbar-collapse -->
</nav>
CSS :
<style>
.top-color {
background-color: aquamarine;
margin-bottom: 0;
}
.firstmenu {
margin-bottom: 0;
}
#media (min-width: 768px) {
.top-color{
width:100%;
margin: 0;
height:5em;
padding-top:10px;
text-align: center;
background: #3399ff;
padding-bottom: 30px;
}
.firstmenu .navbar-brand {
padding-left:155px;
}
.firstmenu li{
padding-left:50px;
}
.firstmenu .active{
width:250px;
}
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
.verticalmenu .navbar-toggle {
display: none ;
}
.navbar.verticalmenu {
float: left;
width: 200px;
height: 100%;
}
.verticalmenu .collapse.navbar-collapse.navbar-ex1-collapse {
display: block;
float: left;
}
.verticalmenu .active {
width:200px;
}
.verticalmenu .navbar-collapse {
height: auto;
border-top: 0;
box-shadow: none;
max-height: none;
padding-left: 0;
padding-right: 0;
}
.verticalmenu .navbar-collapse.collapse {
display: block !important;
width: auto !important;
padding-bottom: 0;
overflow: visible !important;
}
.verticalmenu .navbar-collapse.in {
overflow-x: visible;
}
.verticalmenu .navbar {
max-width: 100px;
margin-right: 0;
margin-left: 0;
}
.verticalmenu .navbar-nav,
.verticalmenu .navbar-nav > li,
.verticalmenu .navbar-left,
.verticalmenu .navbar-right,
.verticalmenu .navbar-header {
float: none !important;
}
.verticalmenu .navbar-right .dropdown-menu {
left: 0;
right: auto;
}
.verticalmenu .navbar-collapse .navbar-nav.navbar-right:last-child {
margin-right: 0;
}
.vmenu{
text-align: center;
}
}
</style>
change the below selector
.navbar.verticalmenu {
width: 200px;
height: 100%;
}
Remove the float:none from .verticalmenu .navbar-header.

btn-navbar never displays when screen width shrinks

I'm trying to create a responsive nav-bar but for some reason the btn-bav bar never displays on the site when the navbar collpases here is my html code for the nav-bar
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a 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>
</a>
<a class="brand" href="index.html">Site Name</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><i class="icon-home">Home</i></li>
<li><i class="icon-film">Film/TV</i></li>
<li><i class="icon-linux">Linux</i></li>
</ul>
<ul class="nav">
<li class="dropdown">
<i class="icon-terminal">Coding</i><b class="caret"></b>
<ul class="dropdown-menu">
<li>JavaScript/Jquery</li>
<li>Link 2</li>
<li>Link 3</li>
</ul>
</li>
</ul>
<form class="navbar-search">
<input type="text" class="search-query" placeholder="Search">
</form>
</div><!--/.nav-collapse -->
</div>
</div>
</div><!--/.end of navbar -->
Why is it that
<a 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>
</a>
doesn't display when the screen size shrinks below 940px.
Here is the realvent css
#media (max-width:979px) {
body {
padding-top:0;
}
.navbar-fixed-top {
position:static;
margin-bottom:18px;
}
.navbar-fixed-top .navbar-inner {
padding:5px;
}
.navbar .container {
width:auto;
padding:0;
}
.navbar .brand {
padding-left:10px;
padding-right:10px;
margin:0 0 0 -5px;
}
.navbar .nav-collapse {
clear:left;
}
.navbar .nav {
float:none;
margin:0 0 9px;
}
.navbar .nav>li {
float:none;
}
.navbar .nav>li>a {
margin-bottom:2px;
}
.navbar .nav>.divider-vertical {
display:none;
}
.navbar .nav .nav-header {
color:#999999;
text-shadow:none;
}
.navbar .nav>li>a,.navbar .dropdown-menu a {
padding:6px 15px;
font-weight:bold;
color:#999999;
-webkit-border-radius:3px;
-moz-border-radius:3px;
border-radius:3px;
}
.navbar .dropdown-menu li+li a {
margin-bottom:2px;
}
.navbar .nav>li>a:hover,.navbar .dropdown-menu a:hover {
background-color:#222222;
}
.navbar .dropdown-menu {
position:static;
top:auto;
left:auto;
float:none;
display:block;
max-width:none;
margin:0 15px;
padding:0;
background-color:transparent;
border:none;
-webkit-border-radius:0;
-moz-border-radius:0;
border-radius:0;
-webkit-box-shadow:none;
-moz-box-shadow:none;
box-shadow:none;
}
.navbar .dropdown-menu:before,.navbar .dropdown-menu:after {
display:none;
}
.navbar .dropdown-menu .divider {
display:none;
}
.navbar-form,.navbar-search {
float:none;
padding:9px 15px;
margin:9px 0;
border-top:1px solid #222222;
border-bottom:1px solid #222222;
-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);
-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);
box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);
}
.navbar .nav.pull-right {
float:none;
margin-left:0;
}
.navbar-static .navbar-inner {
padding-left:10px;
padding-right:10px;
}
.btn-navbar {
display:block;
}
.nav-collapse {
overflow:hidden;
height:0;
}
}
#media (min-width:980px) {
.nav-collapse.collapse {
height:auto !important;
overflow:visible !important;
}
}
Here is the jsfiddle
http://jsfiddle.net/hZktq/
The problem is somewhere on your css. I took your jsfiddle, deleted your css code and added the bootstrap cdn (https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css)
This is the result: http://jsfiddle.net/rCAQH/1/