Foundation - do not want to hide right button of navbar - css

On wider screens my login button is visible, but on smaller screens it is hidden.
JSBIN http://jsbin.com/nowubuseqeza/1/edit?html,js,output
Relevant code:
<div class="top-bar" data-topbar="" style="background:#074e68">
<ul class="title-area">
<li class="name">
<h1><img class="left" src="images/pluslogo.png" style="margin:2px 1em;height:40px;width:40px" alt="Pacific Medical Training"> Pacific Medical Training</h1>
</li>
</ul>
<div class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li class="active">
Login
</li>
</ul>
</div>
</div>
Is it possible to have this visible in all circumstances? Otherwise my users cannot login.

Change your code to this DEMO
<div class="top-bar" data-topbar="" style="background:#074e68">
<div class="top-bar-section right">
<!-- Right Nav Section -->
<ul class="right show-for-small">
<li class="active">
Login
</li>
</ul>
</div>
<ul class="title-area">
<li class="name">
<h1><img class="left" src="images/pluslogo.png" style="margin:2px 1em;height:40px;width:40px" alt="Pacific Medical Training"> Pacific Medical Training</h1>
</li>
</ul>
<div class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li class="active">
Login
</li>
</ul>
</div>
</div>

In the smaller screen, a number of css properties are changing for the title-area and the links in the top-bar. If you add the following, it should bring the login button back on small screens:
//Only use it for screens under 40.063em, using the media query
#media only screen and (max-width: 40.063em) {
.top-bar .name h1 a {
width: auto;
}
.top-bar-section ul {
width: auto;
}
.top-bar-section ul li.active > a {
padding: 0px 15px;
line-height: 45px;
}
.top-bar .title-area {
float: left;
}
}
However, it may need a bit more refinement for very small screens where the "Pacific Medical Training" takes up the whole top-bar and pushes the login button down

Related

CSS Grid auto-fit + minmax only wraps the last element

I'm trying to make a responsive footer using grid and it's almost working but not quite. When the screen is wide everything's spaced out perfectly. Once the screen size gets smaller, the items should start wrapping onto the next implicit row. At least that's what happened in a video guide I watched.
In my case though, for some reason only the last item wraps to the next row while the rest of them stay static causing overflow and horizontal scrolling. I've been trying to figure out what's going for a few hours now but no luck. Am I not seeing something? Please help.
.footer__logo {
width: 40px;
margin-bottom: var(--spacer-xs);
}
.footer__header {
margin-bottom: var(--spacer-xs);
}
.contact-us {
margin-top: var(--spacer-xs);
}
.footer__unit--last {
align-self: end;
}
.footer-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 10px;
}
<footer class="footer">
<div class="container footer-grid">
<div class="footer__unit">
<h3 class="footer__header">Abstract</h3>
<ul class="footer__list">
<li class="footer__item">Start Trial</li>
<li class="footer__item">Pricing</li>
<li class="footer__item">Download</li>
</ul>
</div>
<div class="footer__unit">
<h3 class="footer__header">Resources</h3>
<ul class="footer__list">
<li class="footer__item">Blog</li>
<li class="footer__item">Help Center</li>
<li class="footer__item">Release Notes</li>
<li class="footer__item">Status</li>
</ul>
</div>
<div class="footer__unit">
<h3 class="footer__header">Community</h3>
<ul class="footer__list">
<li class="footer__item">Twitter</li>
<li class="footer__item">LinkedIn</li>
<li class="footer__item">Facebook</li>
<li class="footer__item">Dribble</li>
<li class="footer__item">Podcast</li>
</ul>
</div>
<div class="footer__unit">
<h3 class="footer__header">Comapny</h3>
<ul class="footer__list">
<li class="footer__item">About Us</li>
<li class="footer__item">Careers</li>
<li class="footer__item">Legal</li>
</ul>
<ul class="footer__list contact-us">
<li>
<h4 class="contact-us__header">Contact Us</h4>
</li>
<li class="footer__item">info#abstract.com</li>
</ul>
</div>
<!-- Footer last item -->
<div class="footer__unit footer__unit--last">
<img src="/img/venus-svgrepo-com.svg" alt="logo" class="footer__logo">
<ul class="copyright">
<li class="copyright__item">
<p class="copyright__text">© Copyright 2022</p>
</li>
<li class="copyright__item">
<p class="copyright__text">Abstract Studio Design, Inc.</p>
</li>
<li class="copyright__text">
<p class="copyright__item">All rights reserved</p>
</li>
</ul>
</div>
</div>
</footer>
I made a screenshot, as you can see the last item (copyright section) wraps while the rest of them stays where they are.
https://i.stack.imgur.com/ht35u.png
edit: added screenshot

whenever i click the side navigation menu, the page gets scrolled towards right horizontally

i have a side navigation menu which refers to the sections towards right side of the page ,whenever i resize the window and click the menu , the page gets scrolled horizonatally (scroll postion changing).making the content to overlap. how to fix , i have used overflow:y:hidden option but it doesnt work for small screen size.
html,
body {
height: 100%;
position: relative;
width: 100%;
}
.nav-link {
color: #000000;
border-radius: 9px;
padding-left: 1rem;
padding: 0.25rem 0.5rem;
font-size: 10pt;
}
<div class="set" id="Set">
<div class="content">
<nav id="nav">
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link"> href="#info" </a>
</li>
<li class="nav-item">
<a class="nav-link">href="#section2" </a>
</li>
</ul>
</nav>
<div class="main">
<info ref='info' />
<section2 ref="section2" />
</div>

Bootstrap 4 menu positioning with image

I'm using this template:
http://bootstrap4.guide/
And I want to modify menu a bit, instead of having blue Bootstrap 4 text, I'd like to have a image there. It's looking all fine until I look at mobile view.
I'm expecting to have my image in the same place as the text:
However my image happens to appear under hamburger menu:
This is what I have at the moment:
<nav id='topNav' className='navbar navbar-default navbar-fixed-top'>
<div className='container'>
<button className='navbar-toggler hidden-md-up pull-right' type='button' data-toggle='collapse' data-target='#collapsingNavbar'>
☰
</button>
<a className='navbar-brand page-scroll' href='#first'><img src='logo.png'/></a>
<div className='collapse navbar-toggleable-sm' id='collapsingNavbar'>
<ul className='nav navbar-nav'>
<li className='nav-item'>
<a className='nav-link page-scroll' href='#one'>Cards</a>
</li>
<li className='nav-item'>
<a className='nav-link page-scroll' href='#two'>Flexbox</a>
</li>
<li className='nav-item'>
<a className='nav-link page-scroll' href='#three'>5 Tiers</a>
</li>
<li className='nav-item'>
<a className='nav-link page-scroll' href='#four'>More</a>
</li>
</ul>
<ul className='nav navbar-nav pull-xs-right'>
<li className='nav-item'>
<a className='nav-link page-scroll' data-toggle='modal' title='A free Bootstrap theme' href='#aboutModal'>About</a>
</li>
</ul>
</div>
</div>
</nav>
I've just replaced Bootstrap 4 with this img tag: <img src='logo.png'/>. I'm quite new to bootstrap, if someone would help me to figure out how to sort this out, that'd be great.
I would suggest to divide the the hamburger and the logo in two equal parts by using bootstrap classes for small devices.(col-xs-6)
<div class="col-xs-12">
<div class="col-xs-6">
<button className='navbar-toggler hidden-md-up' type='button' data-toggle='collapse' data-target='#collapsingNavbar'>
☰
</button>
</div>
<div class="col-xs-6">
<a className='navbar-brand page-scroll' href='#first'><img src='logo.png'/></a>
</div>
</div>
Adjust the navbar-brand class as needed for your logo image..
/* responsive nav */
#media(max-width:48em) {
.navbar-default .navbar-nav>.nav-item {
float: none;
margin-left: .1rem;
}
.navbar-default .navbar-nav {
float:none !important;
}
.navbar-default .navbar-brand {
float:none;
}
.navbar-default .navbar-brand img {
display:inline;
}
}
http://codeply.com/go/7HJgyK6nxQ

twitter bootstrap: How to span links in the navbar?

I've tried a few option but i can't manage to get 4 links to span across the navbar. I thought it would be quite easy to add the span3 class to each <li>.
Here's my HTML:
<div class="navbar center">
<div class="navbar-inner">
<div class="container row">
<ul class="nav span12">
<li class="active span3">
Home
</li>
<li class="span3">Link</li>
<li class="span3">Link</li>
<li class="span3">Link</li>
</ul>
</div>
</div>
</div>
To center the links I've used the solution described here: Modify twitter bootstrap navbar
Here's the CSS:
.navbar-inner {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.center.navbar .nav,
.center.navbar .nav > li {
float:none;
display:inline-block;
*display:inline; /* ie7 fix */
*zoom:1; /* hasLayout ie7 trigger */
vertical-align: top;
}
.center .navbar-inner {
text-align:center;
}
All I've managed to get is this:
How can I get those four links spanned on the same row?
Using spanX is not the best solution here (unless you're using bootstrap-resonsive.css, see below). You can uses percentages, as long as you're willing to modify you CSS when the number of items in the navbar changes.
You can make this work with default navbar markup:
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<ul class="nav">
<li>Home</li>
<li>Link</li>
<li>Link</li>
</ul>
</div>
</div>
</div>
And two CSS rules. The first removes the margin on the <ul class="nav">, removes the float and sets its width to be 100% of its container (in this case, the <div class="container"> within <div class="navbar-inner">.
The second rule sets the width of each <li> to be a certain percentage of the width of the <ul>. If you have four items, then set it to 25%. If you have five, it'd be 20%, and so on.
.navbar-inner ul.nav {
margin-right: 0;
float: none;
width: 100%;
}
.navbar-inner ul.nav li {
width: 33%;
text-align: center;
}
jsFiddle DEMO
UPDATE
If you are using the responsive bootstrap CSS, you CAN use the built-in spanX classes, like so:
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<ul class="nav row-fluid">
<li class="span4">Home</li>
<li class="span4">Link</li>
<li class="span4">Link</li>
</ul>
</div>
</div>
</div>
Then, all the CSS you need is:
.navbar-inner ul.nav li {
text-align: center;
}
jsFiddle DEMO
You did a good start but your markup doesn't reflect the real grid :
You don't put .spanX in a .span12
.container and .row might have conflicting properties
It seems to work with this :
<div class="navbar center">
<div class="navbar-inner">
<div class="container">
<div class="row">
<ul class="nav">
<li class="active span3">
Home
</li>
<li class="span3">Link</li>
<li class="span3">Link</li>
<li class="span3">Link</li>
</ul>
</div>
</div>
</div>
</div>
Demo (jsfiddle) and fullscreen

Need FB Comments Box to scroll *under* my position:fixed global navigation bar

I have a position:fixed global navigation bar at the top of the web page.
Currently the FB Comments Box passes over the navigation bar when I scroll down.
I want the FB Comments Box to pass under the navigation bar when I scroll down.
HTML
<div id="header">
<ul id="main-nav">
<li> Home</li>
<li> 2 </li>
<li>3 </li>
<li> 4 </li>
<li> 5 </li>
<li> 6 </li>
<li>7 </li>
<li>8 </li>
<li> 9 </li>
</ul>
</div>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="http://www.example.com/" num_posts="2" width="500" colorscheme="light" style="a"></fb:comments>`
CSS
div#header { width: 100%; border-top:0; background:url(../images/tab.gif); padding-bottom:0em; **position:fixed;** }
ul#main-nav {font-family: Arial, Helvetica, sans-serif;margin:0;padding:0;float:left;width:100%; font-size:1.1em; font-weight:normal;}
Simon
Insert style="z-index:1;"
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="http://www.example.com/" num_posts="2" width="500" colorscheme="light" **style="z-index:1;"**></fb:comments>
Insert z-index=2 into #header

Resources