Header not responsive - html

Dear all i am beginners in Foundation and i am stuck in my code in medium device...i need your suggestion so that i can find my mistake:-below is my code:-
<div class="row">
<div class="large-6 medium-6 small-8 columns">
<ul class="dropdown menu" data-dropdown-menu>
<li class=" " id="logo"><img src="img/home/logo/logo.png"></li>
<li class=" ">Home - Payment Result - contact information</li>
</ul>
</div>
<div class="title-bar" data-responsive-toggle="main-menu" data-hide-for="medium" >
<a id="nav-toggle" href="#" title="Navigation" data-toggle><span></span></a>
<!-- <button class="menu-icon" type="button" data-toggle></button>
<div class="title-bar-title"></div>-->
</div>
<div class="top-bar" id="main-menu" >
<div class="top-bar-right large-5 medium-6 small-4 columns" >
<ul class="menu" data-responsive-menu="drilldown medium-dropdown">
<li>How does it work</li>
<li>My order</li>
<li><span class="icon-cart"></span></li>
<li class="has-submenu">
<span class="icon-face"></span>
<ul class="submenu menu vertical" data-submenu>
<li>Pistachios</li>
<li>Pistachios</li>
<li>Pistachios</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
[please click on screenshot]
enter image description here

Your issue here is that the iPad is a large device and a medium device.
Zurb's documentation says:
Small: any screen.
Medium: any screen 640 pixels or wider.
Large: any screen 1024 pixels or wider.
The iPad's 'CSS resolution' (what the media queries work to) is 1024px x 768px, despite an actual resolution of 2048px x 1536px for the later versions.
So portrait is medium and landscape is large.
So in your above code medium-* will NOT be the visible structure on the iPad and .title-bar WILL, in landscape and vice versa in portrait. So you either have to:
If you're using CSS; create a new breakpoint for the iPad (this is a good resource:
CSS-Tricks - device media queries)
Or, if you're using SASS, you can reuse the mixin in the standard
Foundation SASS package to create specific CSS in a similar way to (1):
#media screen and #{breakpoint(768px)} and #{breakpoint(1024px down)} {
//iPad CSS here
}
Treat it as a large & medium device and change your HTML
.top-bar isn't really part of the grid system either, you have .top-bar-left and .top-bar-right but I'm not sure how much you can control these with columns and rows.
So this might work for you (but it doesn't control the width of left and right sections):
<div class="row">
<div class="large-6 medium-6 small-8 columns end">
<ul class="dropdown menu" data-dropdown-menu>
<li class=" " id="logo">
<img src="img/home/logo/logo.png">
</li>
<li class=" ">Home - Payment Result - contact information</li>
</ul>
</div>
<div class="title-bar" data-responsive-toggle="main-menu" data-hide-for="medium">
<a id="nav-toggle" href="#" title="Navigation" data-toggle><span></span></a>
<!-- <button class="menu-icon" type="button" data-toggle></button>
<div class="title-bar-title"></div>-->
</div>
<div class="top-bar" id="main-menu">
<div class="top-bar-left">
<p class="show-for-large-only">
ERROR
</p>
</div>
<div class="top-bar-right">
<ul class="menu" data-responsive-menu="drilldown medium-dropdown">
<li>How does it work</li>
<li>My order</li>
<li><span class="icon-cart"></span></li>
<li class="has-submenu">
<span class="icon-face"></span>
<ul class="submenu menu vertical" data-submenu>
<li>Pistachios</li>
<li>Pistachios</li>
<li>Pistachios</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
A JSfiddle of this code

Related

Navbar collapse does not work in Tablet View

I have a navbar that does collapse as it should in mobile view but on the tablet (or ipad pro) there is a break or large padding/gap that breaks the navigation. The testing site is at:
padding or margin bottom occurs in tablet view
I have tried a number of things like adjusting the viewport and adding links to bootstraps transition.js and collapse.js files but that is not working either.
<!--navigation bar-->
<nav class="navbar navbar-default transparent navbar-static-top" role="navigation" id="navbar-main">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="row">
<div class="col-lg-12"> <a class="navbar-brand" href="http://patskailua.com/index.php"><img src="http://patskailua.com/images/kailua-beach-properties-llc.png" alt="pats kailua hawaiian Flower" usemap="#Map" class="img-responsive">
</a></div>
</div>
</div>
</div>
</div>
<div class="navbar-header">
<div class="text-center">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navCollapse">
<span class="sr-only">Toggle Navigation</span>
<span class="fa fa-chevron-down"></span> Menu
</button>
<div class="collapse navbar-collapse" id="navCollapse">
<ul class="nav navbar-nav navbar-right">
<li class="active goleft1">vacation rentals</li>
<li>kailua activities</li>
<li class="dropdown">
rentals by size<span class="caret black"></span>
<ul class="dropdown-menu">
<li><a href="http://patskailua.com/wp/three-bedrooms.php" >Three Bedrooms</a></li>
<li>Two Bedrooms</li>
<li>One Bedrooms</li>
<li>Studios</li>
</ul>
</li><li>contact us </li>
<li>about us</li>
<li class="dropdown">
property management and sales<span class="caret black"></span>
<ul class="dropdown-menu">
<li>Property Management</li>
<li>Buying a Property</li>
<li>Selling a Property</li>
<li class="goleft">home</li>
</li>
</ul>
</div>
</nav>
<!--end nav bar-->
If anyone has any ideas on how to fix this, that would be great. Thanks so much. -Beth
You could try changing the class col-lg-12 by col-md-12 or even col-sm-12.
This should make your navbar adapt better smaller resolutions.

Cant quite get mobile navbar working

Trying to make my mobile navbar not coming out quite right. Anyone see the problem? I have only a couple months experience, need a quick hand of help. Much appreciated!
As you can see it doesnt display the navbar right at all. The contact page isnt clickable.Its missing the Services link
*******************
NAV MENU MOBILE
*******************
-->
<div class="menu-wrap mobile">
<div class="container">
<div class="row">
<div class="col-sm-3 no-padding">
<img src="img/logo.png" alt="logo" class="logo-menu">
</div>
<div class="col-sm-9 col-lg-7 col-lg-offset-2 no-padding">
<nav class="nav-menu">
<button class="menu-toggle">
<span class="icon"></span>
<span class="icon"></span>
<span class="icon"></span>
</button>
<ul class="main-menu">
<li class="menu-item active menu-item-has-children">
Home
</li>
<li class="menu-item menu-item-has-children">
<a>Hosting</a>
<ul class="sub-menu">
<li class="menu-item">Shared Hosting</li>
<li class="menu-item">Reseller Hosting</li>
<li class="menu-item">Cloud VPS</li>
<li class="menu-item">Dedicated Server</li>
</ul>
</li>
<li class="menu-item">
Domains
</li>
<li class="menu-item menu-item-has-children">
<a href="blog.html>Blog</a>
</li>
<li class="menu-item menu-item-has-children">
<a href="services.html>Services</a>
</li>
<li class="menu-item menu-last">
<a class="menu-item" href="contact.html">Contact</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
navbar
<a href="services.html>Services</a>
should be
Services
You left out the second ".
In those two links...
<a href="blog.html>Blog</a>
<a href="services.html>Services</a>
...the closing quote of the hrefattribute is missing. Should be
Blog
Services

Foundation 6 - Top-Bar | How can I keep the logo on smaller devices?

I try to create a responsive top-bar with logo, left menu and right menu. On mobile devices I want the horizontal menu to become a vertical menu under a "hamburger icon".
I want the logo to remain always visible. For mobile devices to the left of the hamburger icon. Also add icons.
I checked the example from Zurb, but I don't want the logo/site-title to go inside the hamburger menu on smaller screen.
<div class="title-bar" data-responsive-toggle="main-menu" data-hide-for="medium">
<button class="menu-icon" type="button" data-toggle></button>
</div>
<div class="top-bar">
<li><img src="" > </li>
<div id="main-menu">
<div class="top-bar-left">
<ul class="menu vertical medium-horizontal" data-responsive-menu="drilldown medium-dropdown">
<li>Albums</li>
<li>Music</li>
<li><input type="search" placeholder="Search"></li>
</ul>
</div>
<div class="top-bar-right">
<ul class="dropdown vertical medium-horizontal menu">
<li>Contact</li>
<li>Logout</li>
</ul>
</div>
</div>
</div>
</div>
I want to achieve the following result (it was done with bootstrap)
You can make the image in the small screen different in this case (smaller if needed). The Foundation 6 docs are not that great yet so here is a pretty good implementation of your code. Be sure to include the background-color of your bar. Not much extra css necessary.
<div class="title-bar" style="width:100%;background-color: #262626;">
<div class="title-bar-left hide-for-medium">
<span class="title-bar-title"><img src="http://placehold.it/80x40?text=Viberr" ></span>
<button data-responsive-toggle="responsive-menu" class="menu-icon" type="button" ></button>
</div>
<div id="responsive-menu" >
<div class="top-bar-title">
<img src="http://placehold.it/80x40?text=Viberr" >
</div>
<div class="top-bar-left">
<ul class="menu vertical medium-horizontal" data-responsive-menu="drilldown medium-dropdown">
<li>Albums</li>
<li>Music</li>
<li><input type="search" placeholder="Search"></li>
</ul>
</div>
<div class="top-bar-right">
<ul class="dropdown vertical medium-horizontal menu">
<li>Contact</li>
<li>Logout</li>
</ul>
</div>
</div>
</div>
You need to add a little CSS for this. I have modified the default top bar example.
HTML
<div class="top-bar stacked-for-small">
<div class="top-bar-title">
<span data-responsive-toggle="responsive-menu" data-hide-for="medium">
<button class="menu-icon dark" type="button" data-toggle></button>
</span>
<strong>Site Title</strong>
</div>
<div id="responsive-menu">
<div class="top-bar-left">
<ul class="dropdown menu" data-dropdown-menu>
<li>One</li>
<li>Two</li>
<li><input type="search" placeholder="Search">
<button type="button" class="button">Search</button></li>
</ul>
</div>
<div class="top-bar-right">
<ul class="menu">
<li>One</li>
<li>Two</li>
</ul>
</div>
</div>
</div>
CSS
.menu>li {
display: block;
}
.top-bar input {
float:left;
}
.top-bar-title{
float:none;
}
.top-bar-title span{
float:right;
}
#media (min-width:640px){
.menu>li {
display: table-cell;
}
.top-bar-title{
float: left;
}
}
See the CodePen Example. http://codepen.io/shoaibik/pen/wGORZY

Foundation nav bar acting weird

I use foundation 6 to build my website. Only a problem occurs when I shrink the size of my window.
Picture of my website
Does somebody know how to fix this?
An answer is appreciated.
<nav class="top-bar" data-topbar role="navigation">
<ul class="title-area">
<li class="name">
<h1><a href="#"><b>Pimg</b>
</a>
</h1>
</li>
<!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
<li class="toggle-topbar menu-icon"><span>Menu</span></li>
</ul>
<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li> <div class="entypo-home entipo"></div></li>
<li> <div class="entypo-picture entipo"></div></li>
<li> <div class="entypo-upload entipo"></div></li>
<li> <div class="entypo-user entipo"></div></li>
</ul>
<ul class="left">
<li>Log out</li>
<li class="has-form">
<div class="row collapse">
<div class="medium-8 columns">
<input type="text" placeholder="Search...">
</div>
<div class="medium-4 columns">
Search
</div>
</div>
</li>
</ul>
</section>
</nav>

Submenus (dropdowns) truncated and not displayed on mobile devices

I'm developing a web with Ruby on Rails, using Twitter-Bootstrap and Simple-Navigation gem. The navigation menu works fine on any browser, something like this:
When displaying the web on a mobile device and clicking the nav button, the whole menu is displayed on vertical block, enlarging the size of the header to a max. height than can hold the menu. The problem is that opening any submenú increases the size of the menu, overflowing and hiding the last options, as you can see in the comparison:
Any idea?
The code of nav_menu on the mobile version:
<div class="navbar navbar-static-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="brand">
<img alt="NRG Consulting logo" src="/assets/nrg-logo.png" title="NRG Consulting">
</div>
<span class="development" id="rails-env"><span>development</span></span>
<div class="container nav-collapse in collapse" style="height: 496px;">
<ul class="nav pull-right align-top">
<li>
<a href="manual_path">
Help
</a>
</li>
<li>
Español <img alt="Switch to English" class="lang" data-locale="en" src="/assets/lang-es.png" title="English">
</li>
</ul>
<ul class="nav pull-right align-bottom">
<li id="home">Home</li>
<li id="formulas">Formulas</li>
<li id="deals">Deals</li>
.
.
.
<li class="active dropdown" id="admin">
Admin <b class="caret"></b>
<ul class="dropdown-menu">
<li id="subscription">Subscriptions</li>
<li class="divider" id="nav_header"></li>
<li id="historic">Recalculate historic prices</li>
<li class="divider" id="nav_header"></li>
<li id="export">export data</li>
<li id="import_tuple_eod_check">Check data</li>
<li class="divider" id="nav_header"></li>
<li id="alerts">Alert</li>
<li id="product_price_alerts">Price alerts</li>
<li id="import_tuples">Import tuple</li>
<li id="fixing_errors">fixing errors</li>
<li class="divider" id="nav_header"></li><li id="redis">Resque</li>
<li id="copycopter">Translate</li>
<li class="divider" id="nav_header"></li>
<li class="active simple-navigation-active-leaf" id="client">Clients</li>
<li id="user">Users</li>
<li id="user_activities">User activity</li></ul></li>
<li id="user">Users</li>
</ul>
</div>
</div>
</div>
</div>
Collapsed nav menu appears to set a fixed height value when displaying nav menu, preventing the div to enlarging when submenu dropdowns display:
<div class="container nav-collapse in collapse" style="height: 496px;">
Adding this lines to style.css set height property to auto, allowing the div to enlarge when needed, showing the whole menu:
.container.nav-collapse.in.collapse{
height: auto !important;
}
Perhaps there is a cleaner solution, but this worked pretty fine for me, and don't want to change Bootstrap code itself.
A link displaying some usefull info about similar issues.