Responsive Website Dropdown form issue - zurb-foundation

I am having a bit of a problem with a form on a drop down in the foundation 5 framework.
Basically I am assigning an input field and button to a dropdown menu, which works fine.
But as I can't firstly see a Back button like I can on the first dropdown, I can't see any reasons why. When basic code is a replication.
After viewing the second dropdown and going back to the menu to view dropdown one the input field and button are visible...
Source code below:
CSS:
.has-form-small {
top: 0rem;
left: 0rem;
min-width: 15rem; }
#media only screen and (max-width: 40em) {
.has-form {
min-width: 10rem;
top: 0 rem; }
.has-form .button {
height: 3rem; } }
</style>
HTML:
Dropdown 1:
<section class='top-bar-section'>
<!-- Right Nav Section -->
<ul class='right'>
<li><a href='#'>Button</a></li>
<li class='has-dropdown'>
<a href='#'>Dropdown</a>
<ul class='dropdown'>
<li><a href='#'>link</a></li>
<li><a href='#'>link</a></li>
</ul>
</li>
</ul>
</section>
Dropdown 2:
<section class='top-bar-section'>
<!-- Right Nav Section-->
<strong class='show-for-small-only'>
<ul class='right'>
<li class='has-dropdown'>
<a href='#'>Dropdown2</a>
<ul class='dropdown'>
<li class='has-form-small'>
<div class='row collapse'>
<div class='large-9 small-9 columns'>
<input type='text' placeholder='Find Stuff'>
</div>
<div class='large-3 small-3 columns'>
<a href='#' class='alert button expand'>Search</a>
</div>
</div>
</li>
</ul>
</li>
</ul>
</strong>
</section>

Managed to fix in the end. Turns out a drop down menu option isn't needed.
Code as below:
CSS:
<style>
.has-form-small {
color: darkslategray;
position: absolute;
top: 0rem;
left: 0rem;
min-width: 26rem;
min-height: 2.7rem;}
#media only screen {
.has-form-small {
color: darkslategray;
min-width: 26rem;
min-height: 2.7rem;
top: 0rem; }
.has-form-small .button {
color: darkslategray;
width: 10rem;}}
</style>
HTML:
<nav class='top-bar' data-topbar role='navigation'>
<ul class='title-area'>
<li class='name'>
<h1><a href='#'>My Site</a></h1>
</li>
<strong class='hide-for-small-only'>
<li class='has-form'>
<div class='row collapse'>
<div class='large-9 small-9 columns'>
<input type='text' placeholder='Find Stuff'>
</div>
<div class='large-3 small-3 columns'>
<a href='#' class='alert button expand'>Search</a>
</div>
</div>
</li>
</strong>
<!-- 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'><a href='#'><span>Menu</span></a></li>
</ul>
<section class='top-bar-section'>
<!-- Right Nav Section -->
<ul class='right'>
<li><a>&nbsp</a></li>
<li>
<strong class='show-for-small-only'>
<li class='has-form-small'>
<div class='large-12 small-9 columns'>
<input type='text' placeholder='Find Stuff'>
</div>
<div class='large-3 small-3 columns'>
<a href='#' class='alert button expand'>Search</a>
</div>
</li>
</strong>
</li>
</ul>
<ul class='right'>
<li><a href='#'>Button</a></li>
<li class='has-dropdown'>
<a href='#'>Dropdown</a>
<ul class='dropdown'>
<li><a href='#'>link</a></li>
<li><a href='#'>link</a></li>
</ul>
</li>
</ul>
<!-- Left Nav Section -->
<ul class='left'>
</ul>
</section>
</nav>
There may be better ways to do this (e.g. remove blank row with "&nspb") but I was having issues with background colours, and this is supposed to only be a demo site.

Related

Bug Display whith chrome

I am currently on a python / Django project, I am also using bootstrap.
I have a display bug only with google chrome. When I load my page everything is fine then when I scroll, the bug occurs:
When I reload the page everything is back to normal:
This bug is not present on the project locally, only from production on a server (ubuntu with Gunicorn and Nginx). When I hover the mouse over this white block, the text displays randomly. This is not the only place where it happens. I don't know if this problem is known but I have absolutely no idea what it might be.
here is the part of the code that we see in picture :
<!-- Description content -->
<div class="container-fluid main-color-dark-bg pb-4">
<div lass="row">
<div class="col-lg-8 col-md-10 col-12 mx-auto mb-3">
< Précèdent
Suivant >
</div>
</div>
<!-- Description -->
<div class="row col-lg-8 col-md-10 col-12 mx-auto">
<div class="">
<p class="theoretical-watch-p ext-md-left text-center">
{{ video.description }}
</p>
</div>
</div>
<!-- Sous parties et Ressources -->
<div class="row mx-auto col-lg-8 col-md-10 col-12">
<!-- Sous parties-->
<div class="col-lg-7 col-12 px-0">
<h4 class="theoretical-subpart-title main-color-white text-md-left text-center ">Sous parties</h4>
<ul class="list-unstyled text-md-left text-center">
{% for s in subparts %}
<li class="">
<a href="{{s.subpart_url}}" class="subpart-link">
{{s.subpart_title |title}}
<span class="subpart-hook">[<span>
{% if s.subpart_time.hour == 0 %}
{{ s.subpart_time|time:"i:s" }}
{% else %}
{{ s.subpart_time|time:"H:i:s" }}
{% endif %}
<span class="subpart-hook">]<span>
</a>
</li>
{% endfor %}
</ul>
</div>
<!-- Ressources -->
<div class="col-lg-5 col-12 my-md-0 my-4 text-center mx-auto">
TÉLÉCHARGER LES RESSOURCES
</div>
</div>
</div>
<!-- End Description content -->
</div>
<!-- TAB Menu header mr-lg-auto mx-md-auto mx-sm-auto mx-auto -->
<div class="row col-12 px-0 mx-auto">
<ul class="nav mx-auto d-flex d-inline-flex" id="myTab" role="tablist">
<li class="d-inline-flex">
<a class="nav-link theoretical-tab-link active" id="tab-memo" data-toggle="tab" href="#content-memo" role="tab" aria-controls="content-memo" aria-selected="true">
Les points clés du chapitre
</a>
</li>
<li id="header-tab-program" class="d-inline-flex">
<a class="nav-link theoretical-tab-link" id="tab-program" data-toggle="tab" href="#content-program" role="tab" aria-controls="content-program" aria-selected="false">
Contenu du cours
</a>
</li>
<li class="d-inline-flex">
<a class="nav-link theoretical-tab-link" id="tab-definitions" data-toggle="tab" href="#content-definitions" role="tab" aria-controls="content-definitions" aria-selected="false">
Lexique
</a>
</li>
</ul>
</div>
<!-- TAB Menu content -->
<div class="">
<div class="tab-content w-100" id="myTabContent">
<!-- MEMO -->
<div class="tab-pane fade active show" id="content-memo" role="tabpanel" aria-labelledby="tab-memo">
<!-- Title vidéo et description -->
<div class="col-lg-8 col-12 mx-auto mb-5">
<!-- Title -->
<div class="row px-0 section-title my-auto col-12 mx-auto">
<div class="col-12 mx-auto my-auto">
<h1 class="mx-auto section-title text-center">
<hr class="main-color-grey-bg">
<img class="img-left" width="2%" height="auto" src="{% static 'images/pictograms/clover-black.svg' %}">
MÉMO
<img class="img-right" width="2%" height="auto" src="{% static 'images/pictograms/heart-red.svg' %}">
<hr class="main-color-grey-bg">
</h1>
</div>
</div>
<!-- APERCU - SECTION LEXIQUE -->
<div class="row mx-0">
<!-- colonne contenu -->
<div class="col-12">
<ul class="list-unstyled mt-5">
{% for sp in subparts %}
{% if sp.subpart_memo%}
<li class="theoretical-tab-content-p-memo">
<h4 class="">{{ sp.subpart_title |title }}</h4>
<p class="theoretical-tab-content-p-memo">
{{ sp.subpart_memo | safe | linebreaks}}
</p>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
<!-- END MEMO -->
I don't use anything in particular in the code. I hope that someone could help me!
After multiple tests I finally identified the problem and solved.
The display bugs (as a reminder, only on google chrome), as seen in the videos and images came from a line that I had placed in my css file.
in my body I had the line overflow: overlay;
body{
font-family: 'main-font-medium', Fallback, serif;
font-weight: 0;
font-style: normal;
/*overflow: auto;*/
overflow-x: hidden!important;
scroll-behavior: smooth;
}
thanks to you JuhonRutila !
I hope this can help other people.

How does bootstrap 3 set template image?

I am working with django and bootstrap3. I've downloaded a template from from http://startbootstrap.com/template-overviews/landing-page/ . The github repo is https://github.com/IronSummitMedia/startbootstrap-landing-page/blob/gh-pages/index.html
This contains The following in the index.html:
<div class="row">
<div class="col-lg-12">
<div class="intro-message">
<h1>Landing Page</h1>
<h3>A Template by Start Bootstrap</h3>
<hr class="intro-divider">
<ul class="list-inline intro-social-buttons">
<li>
<i class="fa fa-twitter fa-fw"></i> <span class="network-name">Twitter</span>
</li>
<li>
<i class="fa fa-github fa-fw"></i> <span class="network-name">Github</span>
</li>
<li>
<i class="fa fa-linkedin fa-fw"></i> <span class="network-name">Linkedin</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- /.container -->
</div>
<!-- /.intro-header -->
How is the introductory photo included here. I see the stock photo at https://github.com/IronSummitMedia/startbootstrap-landing-page/blob/gh-pages/img/intro-bg.jpg . I assume this is some bootstrap3 magic?
put the correct url in the landing-page.css
.intro-header {
background: url(../img/intro-bg.jpg) no-repeat center center;
background-size: cover;
}
thats it

Linking display of hamburger icon with custom breakpoint

In my foundation_and_overrides.scss, I have changed the topbar-breakpoint to a particular px width. I'd like to display the hamburger icon when the width is less than the breakpoint.
Right now it removes the menu and leaves it blank until I hit $small-range. I'm not sure where to edit within the foundation_and_overrides.scss to display the hamburger icon/menu when it hits the new breakpoint.
SCSS
$topbar-breakpoint: 1225px; // Change to 9999px for always mobile layout
$topbar-media-query: "only screen and (min-width: #{$topbar-breakpoint})" !default;
HTML
<div class="fixed header" style="border-bottom: 1px solid #000;">
<nav class="top-bar" data-topbar role="navigation">
<ul class="title-area">
<li class="name">
<h1><img src="/assets/logo.png" alt="" id="logo-image"></h1>
</li>
<li class="toggle-topbar menu-icon"><span>Menu</span></li>
</ul>
<section class="top-bar-section">
<ul class="left">
<li><a href='/programs'>Programs</li>
<li><a href='/projects'>Projects</li>
</ul>
</section>
</nav>
</div>

Foundation 5: removing a gap at the left of my column

I want to get rid of the gap at the left of my green button on this screenshot. I can't seem to find any way to remove it.
Markup:
<div class="row">
<div class="small-4 medium-5 large-4 columns">
<a class="button" id="enroll_in_mooc" href="#">Enroll in MOOC</a>
</div>
<div class="small-6 medium-5 large-6 columns">
<ul class="small-block-grid-1 large-block-grid-2" id="jason_computing_features_list">
<li id="jason_computing_self_paced">Self-paced</li>
<li id="jason_computing_hours_week">4 hours a week</li>
<li id="jason_computing_assignments">3 Assignments</li>
<li id="jason_computing_challenges">18 Challenges</li>
</ul>
</div>
</div>
aa
By default, Foundation applies a right and left padding to columns. I've created a snippet with a couple of options. You can target the column; or simply create a class and add a rule for left-padding.
/* -- target the first-child column -- */
.row .columns:first-child {
padding-left: 0;
}
/* -- create a class ('button-enroll' for example ) -- */
.button-enroll {
padding-left: 0;
}
<link href="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.4.6/css/foundation.min.css" rel="stylesheet"/>
<div class="row">
<div class="small-4 medium-5 large-4 columns button-enroll">
<a class="button" id="enroll_in_mooc" href="#">Enroll in MOOC</a>
</div>
<div class="small-6 medium-5 large-6 columns">
<ul class="small-block-grid-1 large-block-grid-2" id="jason_computing_features_list">
<li id="jason_computing_self_paced">Self-paced</li>
<li id="jason_computing_hours_week">4 hours a week</li>
<li id="jason_computing_assignments">3 Assignments</li>
<li id="jason_computing_challenges">18 Challenges</li>
</ul>
</div>
</div>

Zurb Foundation top bar with right section that wraps under first

Similar to this post
A Top Bar with 2 navigation rows - Zurb Foundation 5
and this example
http://jsfiddle.net/Ty3ZT/6/
I would like to have a search form on the right side with a longer search box (the default is so small). As the screen size is smaller I'd like the second section containing the search form to wrap under the first section so that the top bar becomes twice in height.
Here is how I'd like it to end up:
This is as close as I've gotten it. (unsure why the search input is not the same height as the button, they are on my local install)
http://jsfiddle.net/Ty3ZT/18/
<div class="fixed">
<nav class="top-bar hide-for-small expand" data-topbar>
<ul class="title-area">
<li class="name">
<h1>My Site</h1>
</li>
<li class="toggle-topbar menu-icon">Menu</li>
</ul>
<!--first row-->
<section class="top-bar-section">
<!-- Left Nav Section -->
<ul class="left">
<li class="has-dropdown"><a class="">Account</a>
<ul class="dropdown">
<li><a>Item 1</a></li>
<li><a>Item 2</a></li>
<li><a>Item 3</a></li>
</ul>
</li>
</ul>
</section>
<!--second row-->
<section class="top-bar-section">
<!-- Left Nav Section -->
<ul class="right">
<li class="has-form">
<div class="row collapse">
<div class="large-8 columns">
<input type="text" placeholder="Search here">
</div>
<div class="large-4 columns">
Search
</div>
</li>
</ul>
</section>
</nav>
</div>
How can I achieve this? Whenever I get the second section to wrap the search form is all messed up. button no longer inline.