height as parent and position inside navbar - html

I've modified for the third time, and now it looks clearer. Here is the link:
http://jsfiddle.net/3w2gdfqp/
html
<div id="navWrap">
<div class="mainContainer">
<nav class="navbar navbar-default">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<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 id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav col-md-18">
<li class="active">HOME</li>
<li>OUR PHILOSOPHY</li>
<li>OFFERS</li>
<li>FINE WINE</li>
<li>CONTACT</li>
</ul>
<div class="searchBoxContainer col-md-5 pull-right">
<div id="searchOurWines" class="blackBox">
<span id="textSearchBox" class="textInBox">SEARCH OUR WINES</span>
<span id="iconSearchBox">
<span class="icon-icn-bottle"></span>
<a href=""><span id="arrowSearch" class="icon-icn-sort_down"></span>
<span id="arrowSearch2" class="icon-icn-sort_up"></span></a>
</span>
</div>
</div>
<div class="clearfix"></div>
</div><!--/.nav-collapse -->
</nav>
</div>
</div>
css
/*Navigation bar*/
#navbar{
padding:0;
}
.navbar{
border-radius:0;
min-height:40px;
}
.navbar.navbar-default{
border:0;
margin:0;
}
.navbar-nav > li > a {
padding-top:10px;
padding-bottom:10px;
}
#navWrap{
background-color:#808080;
}
#arrowSearch2{
display:none;
}
.searchBoxContainer{
border:1px solid pink;
}
as you see, the SEARCH OUR WINES, doesn't have the same height as the navigation bar, and I've tried everything I could!!
Any suggestions??
thanksss

See if the below one works :
<ul class="nav navbar-nav">
<li class="active">HOME</li>
<li>OUR PHILOSOPHY</li>
<li>OFFERS</li>
<li>FINE WINE</li>
<li>TOUR & TASTE</li>
<li>CONTACT</li>
<li><div class="searchBoxContainer col-md-5 pull-right">
<div id="searchOurWines">
<div id="containerSearch" class="blackBox">
<span id="textSearchBox" class="textInBox">SEARCH OUR WINES</span>
<span id="iconSearchBox">
<span class="icon-icn-bottle"></span>
<a href=""><span id="arrowSearch" class="icon-icn-sort_down pull-right"></span>
<span id="arrowSearch2" class="icon-icn-sort_up pull-right"></span></a>
</span>
</div>
</div>
</div>
</li>
</ul>
and shift the search box at right side by css if it is not already

Related

collapsible bootstrap not returning and colored black

i already have a collapsible navbar but i have just issues with three things:
collapsible not returning back when clicked (if list is dropped down)
unnecessary underline
collapsible button is black
also added the navbar-toggle in navbar header so that they stay in the same row
any help would be appreciated thank you.
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header logo">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="img/logo_png_solo.png">
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-left" id="nav-design">
<li>Home</li>
<li>FAQ</li>
<li>Membership</li>
<li>Cards</li>
<li>Settings</li>
<li>Login</li>
<li>Register</li>
</ul>
</div>
</nav>
JS Fiddle: https://jsfiddle.net/9txzarws/
Try this:
.navbar-nav.navbar-center {
position: absolute;
left: 50%;
transform: translatex(-50%);
}
.logo img {
height: 50px;
transition: 5s;
}
.icon-bar {
background-color: black;
}
.navbar ul li a {
color: black;
text-align: center;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css">
<div class="bg-color-white strong">
<div class="container">
<br>
<nav class="navbar">
<div class="container-fluid">
<div class="navbar-header logo">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="https://via.placeholder.com/100x50.png">
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-left" id="nav-design">
<li>Home</li>
<li>FAQ</li>
<li>Membership</li>
<li>Cards</li>
<li>Settings</li>
<li>Login</li>
<li>Register</li>
</ul>
</div>
</div>
</nav>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.js"></script>
You can try the following fiddle. Hope this will solve your mentioned issues
collapsible not returning back when clicked (if list is dropped
down)
unnecessary underline
collapsible button is black
Try this fiddle
<html >
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<style>
.navbar {
background: white;
border: white;
}
.navbar-nav.navbar-center {
position: absolute;
left: 50%;
transform: translatex(-50%);
}
.icon-bar{
background-color:#000
}
.logo img {
height: 50px;
transition: 5s;
}
.navbar-nav{
text-align:center;
}
.navbar-nav a{
color:#000;
font-weight:bold;
font-size:18px
}
</style>
<body>
<div class="bg-color-white strong">
<div class="container">
<br>
<nav class="navbar">
<div class="container-fluid">
<div class="navbar-header logo">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="img/logo_png_solo.png">
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-left" id="nav-design">
<li>Home</li>
<li>FAQ</li>
<li>Membership</li>
<li>Cards</li>
<li>Settings</li>
<li>Login</li>
<li>Register</li>
</ul>
</div>
</nav>
</div>
<div>
</div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"> .
</script>
</html>

Bootsrap 3 drop - down submenu links not working in mobile view

I created a drop down sub menu in bootstrap 3, in which the links are working (It goes to respective pages). But, While i shrink the browser to look as if like a mobile view, the links of the sub menus are not working(It goes to different page while the menu is clicked).
The following image depicts the issue with my issue.
From the above image, if i move the curser to click the 'tamil newsletter', it is moving to 'gallery' page.
I feel there is a simple solution for this issue and i do not know where i am wrong.
The following is my code:-
<nav id="navbar-section" class="navbar navbar-default navbar-static-top navbar-sticky" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
<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 id="navbar-spy" class="collapse navbar-collapse navbar-responsive-collapse">
<ul class="nav navbar-nav pull-right">
<li>
About Us
</li>
<li>
Support Us
</li>
<li class="active dropdown">Newsletter
<ul class="nav navbar-nav pull-right dropdown-menu" role="menu">
<li>Tamil Newsletter</li>
<li>English Newsletter</li>
</ul>
</li>
<li>
<span>Gallery</span>
</li>
<li>
<span>Contact Us</span>
</li>
</ul>
</div>
</div>
</nav>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<nav id="navbar-section" class="navbar navbar-default navbar-static-top navbar-sticky" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
<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 id="navbar-spy" class="collapse navbar-collapse navbar-responsive-collapse">
<ul class="nav navbar-nav pull-right">
<li>
About Us
</li>
<li>
Support Us
</li>
<li class="active dropdown">Newsletter
<ul class="nav navbar-nav pull-right dropdown-menu" role="menu">
<li>Tamil Newsletter</li>
<li>English Newsletter</li>
</ul>
</li>
<li>
<span>Gallery</span>
</li>
<li>
<span>Contact Us</span>
</li>
</ul>
</div>
</div>
</nav>
You are using bootstrap nav already... The pull-right which you added to dropdown-menu is creating the problem....
So as a quick patch, add this to you css.. add more specificity if there are other dropdown-menus on the page.
#media(max-width: 768px){
#navbar-spy > .navbar-nav{
border-left: 1px solid #ddd;
margin: 0 -15px;
width: 170px;
}
#navbar-spy .dropdown-menu.pull-right {
float: none !important;
}
#navbar-spy .dropdown-menu.navbar-nav{
margin:0;
font-size: 13px;
padding: 0;
}
#navbar-spy .navbar-nav .open .dropdown-menu.navbar-nav > li > a{
padding:2px 10px 2px 20px;
border-bottom: 1px solid #ddd;
}
}

unwanted space between navigation bar and div(red color)

I am getting an unwanted space like this between red color div and header
my html is i've give 0 value for margin and padding for html and body.But still there's a problem please help
<header>
<nav role="navigation" class="navbar navbar-fixed navbar-inverse">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle nav-button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
Example
</div>
<!-- Collection of nav links and other content for toggling -->
<div id="navbarCollapse" class="collapse navbar-collapse">
<ul class="nav navbar-nav nav-ul">
<li id="tech" class="nav-list"> home</li>
<li id="politics" class="nav-list"> careers</li>
<li id="crime" class="nav-list"> about</li>
<li id="business" class="nav-list"> contact</li>
</ul>
</div>
</nav>
</header>
<section class="frontpage">
<div class="container">
<div class="row">
<div class="col-md-5">
</div>
</div>
</div>
</section>
<section class="ghi">
<div class="container">
<div class="row">
<div class="col-md-5">
</div>
</div>
</div>
</section>
and css is i've also tried giving 0 padding and margins for div and header
body,html {
margin:0;
padding:0;
}
header{
margin:0;
padding:0;
}
.frontpage{
background:red;
height:200px;
margin:0;
padding:0;
}
.ghi{
background:blue;
height:220px;
}
use it
.navbar{
margin-bottom: 0!important;
}
body,html {}
header{}
.frontpage{
background:red;
height:200px;
}
.ghi{
background:blue;
height:220px;
}
.navbar{
margin-bottom: 0!important;
}
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />
<header>
<nav role="navigation" class="navbar navbar-fixed navbar-inverse">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle nav-button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
Example
</div>
<!-- Collection of nav links and other content for toggling -->
<div id="navbarCollapse" class="collapse navbar-collapse">
<ul class="nav navbar-nav nav-ul">
<li id="tech" class="nav-list"> home</li>
<li id="politics" class="nav-list"> careers</li>
<li id="crime" class="nav-list"> about</li>
<li id="business" class="nav-list"> contact</li>
</ul>
</div>
</nav>
</header>
<section class="frontpage">
<div class="container">
<div class="row">
<div class="col-md-5">
</div>
</div>
</div>
</section>
<section class="ghi">
<div class="container">
<div class="row">
<div class="col-md-5">
</div>
</div>
</div>
</section>
It is because the Browser is adding default margins to the ul Elements. Add this style to your css and it should fix the issue:
ul.nav { margin-bottom: 0 !important; }
Just in case someone else have same problem. I fixed it based on reading https://css-tricks.com/fighting-the-space-between-inline-block-elements/ in my case just added this line margin-bottom: -10px;

Bootstrap header/jumbotron background image

I'm messing around with Bootstrap for the first time and was struggling to get an image as the background for a header that included the nav and jumbotron. Currently the image I've set isn't showing up and I'm not sure why. If you could point me in the right direction as to where or what needs to change it would be appreciated.
<div class="container header-bg">
<nav class="navbar" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<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="#">Elliott Davidson</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav pull-right">
<li>About</li>
<li>Pictures</li>
<li>Videos</li>
<li>Sponsors</li>
<li>Blog</li>
<li>Contact</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="jumbotron">
<div class="container">
<h1>Elliott Davidson</h1>
<p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
</div>
</div>
</div>
.header-bg {
width:100%;
height:475px;
background: url("img/elliott-davidson-slider.jpg");
background-size:cover;
}
.jumbotron {
color: white;
text-shadow: black 0.3em 0.3em 0.3em;
background: transparent;
}
background: url("../img/elliott-davidson-slider.jpg");
By – Yerko Palma
Try adding "background-image" like so:
.header-bg {
width:100%;
height:475px;
background-image: url("img/elliott-davidson-slider.jpg");
background-size:cover;
}

HTML Background Positioning

I've been trying to determine how to do a background like having a negative margin. Here is a picture of what I have done as of now
The picture below show what I want as a result
Im trying to use a negative margin but no luck at all. Here is my code as of now
HTML
<div class="container">
<div class="navbar navbar-custom radius-fixer nomargin" role="navigation">
<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>
</div>
<div class="navbar-collapse collapse nopaddingright">
<ul class="nav navbar-nav">
<li class="active">HOME</li>
<li>ABOUT US</li>
<li>FAQ</li>
<li>CONTACT US</li>
<li>ONLINE FORMS</li>
<li>VIRTUAL CLINIC TOUR</li>
<li>BLOG</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container-fluid -->
</div>
<div class="clearfix" id="main">
<div class="container">
<div class="flexslider nomargin">
<ul class="slides">
<li>
<img src="SLIDER1" />
</li>
<li>
<img src="SLIDER2" />
</li>
<li>
<img src="SLIDER3" />
</li>
</ul>
</div>
</div>
</div>
FOR MY CSS
#main{
background: #bf35bc;
background-position: top;
}
A reply is really appreciated.
You should be able to achieve what you want by applying a negative top margin to the main element:
margin-top: -40px;
That will pull the div up. See http://jsfiddle.net/raad/f6r1Lvf9/embedded/result/
EDIT
I have forked the Bootply example from the question, and added a negative top margin: http://www.bootply.com/5n8DsKXPQG
It appears to do what is needed.
this is negative top margin: margin-top: -50px;
so try
#main{
background: #bf35bc;
background-position: top;
margin-top: -50px;
}