I am experiencing an issue with the layout of my page that has 2 divs within one nav element. When the screen width is greater than 1024px, everything looks fine. However, when I reduce the width to less than 768px, the two divs merge into one line instead of remaining on separate lines. I want them to stay in two different lines even as the screen size decreases
$(document).ready(function() {
var navpos = $('#product-nav').offset();
console.log(navpos.top)
$(window).bind('scroll', function() {
if ($(window).scrollTop() > navpos.top) {
$('#product-nav').addClass('fixed');
} else {
$('#product-nav').removeClass('fixed');
}
});
});
.mc-navbar {
font-size: 17px;
background-color: #f8f8f8;
border-color: #ffffff;
margin-bottom: 0;
}
.navbar-default .mc-navbar-brand {
color: #3c6190;
}
.navbar-default .mc-navbar-brand:focus,
.navbar-default .mc-navbar-brand:hover {
color: #3c6190;
}
.mc-navbar-right {
font-size: 16px;
margin-right: 0;
}
.mc-partner-nav {
background-color: #FFFFFF;
}
.mc-partner {
margin-right: 20px;
text-align: right;
font-family: 'Open Sans', sans-serif;
font-weight: 300;
line-height: 30px;
font-style: italic;
font-size: 18px;
}
#logo {
margin-top: 10px;
margin-bottom: 10px;
width: 150px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<nav class="navbar navbar-default mc-navbar">
<div id="product-nav">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="caret"></span>
</button>
<a href="manage.php" class="navbar-brand mc-navbar-brand">Product 1</a>
<div id="navbar" class="collapse navbar-collapse nav-pills">
<ul class="nav navbar-nav navbar-right mc-navbar-right">
<li><a href="manage.php">Manage</a>
</li>
<li><a href="diagnose.php">Diagnose</a>
</li>
</ul>
</div>
<div class="mc-partner-nav">
<div class="mc-partner">In partnership with
<a href="#partner" target="_blank">
<img src="https://upload.wikimedia.org/wikipedia/commons/a/ab/Logo_TV_2015.png" id="logo">
</a>
</div>
</div>
</div>
</nav>
Link to jsfiddle https://jsfiddle.net/3L1ygooa/1/