I'm currently struggling with the bulma navbar. This is my header:
<header class="navbar">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item">
<span class="icon has-text-primary is-large">
<i class="mdi mdi-36px mdi-hexagon-multiple"></i>
</span>
<!-- <h1 class="title is-1">DNW</h1> -->
</a>
<span class="navbar-burger burger" data-target="navbarMenuHeroC">
<span></span>
<span></span>
<span></span>
</span>
</div>
<div class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item">
Home
</a>
<a class="navbar-item">
Forum
</a>
<a class="navbar-item">
Spiele
</a>
<div class="navbar-item has-dropdown is-hoverable is-arrowless">
<div class="navbar-link">
<img class="nav-profilepic" src="https://static.wixstatic.com/media/1bfda4_6f8ae00a346644a89245f331fc6c6b8e~mv2_d_3476_5214_s_4_2.jpeg?dn=">
Tränenreich
</div>
<div class="navbar-dropdown">
<a class="navbar-item">
Profil
</a>
<a class="navbar-item">
Nachrichten
</a>
<a class="navbar-item">
Rangliste
</a>
<hr class="navbar-divider">
<a class="navbar-item">
Hilfe
</a>
<a class="navbar-item">
Einstellungen
</a>
<a class="navbar-item">
Mod-Forum
</a>
</div>
</div>
</div>
</div>
</div>
</header>
The dropdown menu should show a blue arrow. But it doesn't show in Chrome nor in Firefox. Any ideas how to fix this?
I'd expect the output to show a dropdown arrow on the right next to "Tränenreich". Hovering works perfectly fine.
Greetings
Your code combined with an unedited Bulma file is showing an arrow next to the dropdown item. See demo below (you'll have to see full page perhaps because nav is changed to hamburger menu from tablet down).
My guess is either you've edited the Bulma CSS in a way that is breaking the arrow OR you have some custom CSS that is conflicting with it.
The arrow is created using a :after pseudo element.
.navbar-link:not(.is-arrowless)::after,
.select:not(.is-multiple):not(.is-loading)::after {
border: 3px solid transparent;
border-radius: 2px;
border-right: 0;
border-top: 0;
content: " ";
display: block;
height: .625em;
margin-top: -.4375em;
pointer-events: none;
position: absolute;
top: 50%;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-transform-origin: center;
transform-origin: center;
width: .625em;
}
Check your custom CSS to see if you have anything that is styling :after elements that is affecting the nav-item.
<link href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.4/css/bulma.min.css" rel="stylesheet"/>
<header class="navbar">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item">
<span class="icon has-text-primary is-large">
<i class="mdi mdi-36px mdi-hexagon-multiple"></i>
</span>
<!-- <h1 class="title is-1">DNW</h1> -->
</a>
<span class="navbar-burger burger" data-target="navbarMenuHeroC">
<span></span>
<span></span>
<span></span>
</span>
</div>
<div class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item">
Home
</a>
<a class="navbar-item">
Forum
</a>
<a class="navbar-item">
Spiele
</a>
<div class="navbar-item has-dropdown is-hoverable is-arrowless">
<div class="navbar-link">
<img class="nav-profilepic" src="https://static.wixstatic.com/media/1bfda4_6f8ae00a346644a89245f331fc6c6b8e~mv2_d_3476_5214_s_4_2.jpeg?dn=">
Tränenreich
</div>
<div class="navbar-dropdown">
<a class="navbar-item">
Profil
</a>
<a class="navbar-item">
Nachrichten
</a>
<a class="navbar-item">
Rangliste
</a>
<hr class="navbar-divider">
<a class="navbar-item">
Hilfe
</a>
<a class="navbar-item">
Einstellungen
</a>
<a class="navbar-item">
Mod-Forum
</a>
</div>
</div>
</div>
</div>
</div>
</header>
Related
I have a Bulma Navbar and there is too much elements in it which cause it to overflow on the right of the page. Is it possible to make a second line ?
<nav class="is-dark has-background-white">
<div class="navbar-brand is-hidden-desktop">
<div class="navbar-burger">
<span></span>
<span></span>
<span></span>
</div>
</div>
<div class="navbar-menu">
<div class="navbar-start">
<div class="navbar-item has-dropdown is-hoverable">
<span>Text Here</span>
<div class="navbar-dropdown">
<a class="navbar-item">
Overview
</a>
<a class="navbar-item">
Elements
</a>
<a class="navbar-item">
Components
</a>
<a class="navbar-item">...</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">...</div>
</div>
<div class="navbar-end">
</div>
</div>
</nav>
When I open bulma dropdown it gets opened on the right and some part is even outside from screen. How can I force it to pen dropdown on the left?
Currently, it looks like this:
So the goal is to open it on the left from the Account item
<nav class="navbar" role="navigation" aria-label="dropdown navigation">
<div class="navbar-item has-dropdown is-active">
<a class="navbar-link">
Docs
</a>
<div class="navbar-dropdown">
<a class="navbar-item">
Overview
</a>
<a class="navbar-item">
Elements
</a>
<a class="navbar-item">
Components
</a>
<hr class="navbar-divider">
<div class="navbar-item">
Version 0.9.1
</div>
</div>
</div>
</nav>
How can be it solved?
According to the documention about the dropdown component, you can add the is-right class to have a right-aligned dropdown, so the overflow will be on the left side.
It also works on navbar's dropdowns, your code should look like this :
<nav class="navbar" role="navigation" aria-label="dropdown navigation">
<div class="navbar-item has-dropdown is-active">
<a class="navbar-link">
Docs
</a>
<div class="navbar-dropdown is-right">
<a class="navbar-item">
Overview
</a>
<a class="navbar-item">
Elements
</a>
<a class="navbar-item">
Components
</a>
<hr class="navbar-divider">
<div class="navbar-item">
Version 0.9.1
</div>
</div>
</div>
</nav>
Result :
I need to make a second level of navbar appear from the top of the dropdown container, like this:
What I need to do
However, I only managed to do it like this(immigrations link hovered), using flexbox:
What I have done
And here is code that I have used:
.nav-more {
display: flex;
}
.more-dropdown {
position: relative;
display: flex;
}
.more-dropdown-content {
position: absolute;
display: flex;
flex-direction: column;
visibility: hidden;
}
.nav-more:hover .more-dropdown-content {
visibility: visible;
}
<div class="nav-more">
<a href="price.html" class="dropdown-link">
<p>Immigrations<img src="images/arrow-right.svg" class="dropdown-arrow"></p>
</a>
<div class="nav-more">
<div class="more-dropdown-content">
<a href="#" class="dropdown-link">
<p>1</p>
</a>
<a href="#" class="dropdown-link">
<p>2</p>
</a>
<a href="#" class="dropdown-link">
<p>3</p>
</a>
<a href="#" class="dropdown-link">
<p>4</p>
</a>
<a href="#" class="dropdown-link">
<p>5</p>
</a>
<a href="#" class="dropdown-link">
<p>6</p>
</a>
</div>
</div>
</div>
I am not clear on your question's code if you could send some more HTML and CSS but as far as I understand I think something like this must work
<div>//make it flex and direction column
<div> // make it flex and direction row
<div>
<div class="nav-more">
<a href="price.html" class="dropdown-link">
<p>Immigrations<img src="images/arrow-right.svg" class="dropdown-arrow"></p>
</a>
<div class="nav-more">
<div class="more-dropdown-content">
<a href="#" class="dropdown-link">
<p>1</p>
</a>
<a href="#" class="dropdown-link">
<p>2</p>
</a>
<a href="#" class="dropdown-link">
<p>3</p>
</a>
<a href="#" class="dropdown-link">
<p>4</p>
</a>
<a href="#" class="dropdown-link">
<p>5</p>
</a>
<a href="#" class="dropdown-link">
<p>6</p>
</a>
</div>
</div>
</div></div></div>
I'm coding using the Front-ENd Web Development [The Big Nerd Ranch Guide] book to help me better understand css and javascript. There's a project where I'm learning how to use media queries and im suppose to changed the flex-direction property from a row to a column. I've copied the code as its shown and for some odd reason the code doesn't change the direction. It Follows everything before and after that piece of code. I'm hoping a extra pair of eyes can help me spot where I went wrong and help me understand media-queries & flexbox better.
<main class="main-content">
<ul class="thumbnail-list">
<li class="thumbnail-item">
<a href="#">
<img src="img/otter1.jpg" alt="Barry The Otter" class="thumbnail-image">
<span class="thumbnail-title">Barry</span>
</a>
</li>
<li class="thumbnail-item">
<a href="#">
<img src="img/otter2.jpg" alt="Robin The Otter" class="thumbnail-image">
<span class="thumbnail-title">Robin</span>
</a>
</li>
<li class="thumbnail-item">
<a href="#">
<img src="img/otter3.jpg" alt="Maurice The Otter" class="thumbnail-image">
<span class="thumbnail-title">Maurice</span>
</a>
</li>
<li class="thumbnail-item">
<a href="#">
<img src="img/otter4.jpg" alt="Lesley The Otter" class="thumbnail-image">
<span class="thumbnail-title">Lesley</span>
</a>
</li>
<li class="thumbnail-item">
<a href="#">
<img src="img/otter5.jpg" alt="Barbara The Otter" class="thumbnail-image">
<span class="thumbnail-title">Barbara</span>
</a>
</li>
<li class="thumbnail-item">
<a href="#">
<img src="img/otter1.jpg" alt="Barry The Otter" class="thumbnail-image">
<span class="thumbnail-title">Barry</span>
</a>
</li>
<li class="thumbnail-item">
<a href="#">
<img src="img/otter2.jpg" alt="Robin The Otter" class="thumbnail-image">
<span class="thumbnail-title">Robin</span>
</a>
</li>
<li class="thumbnail-item">
<a href="#">
<img src="img/otter3.jpg" alt="Maurice The Otter" class="thumbnail-image">
<span class="thumbnail-title">Maurice</span>
</a>
</li>
<li class="thumbnail-item">
<a href="#">
<img src="img/otter4.jpg" alt="Lesley The Otter" class="thumbnail-image">
<span class="thumbnail-title">Lesley</span>
</a>
</li>
<li class="thumbnail-item">
<a href="#">
<img src="img/otter5.jpg" alt="Barbara The Otter" class="thumbnail-image">
<span class="thumbnail-title">Barbara</span>
</a>
</li>
</ul>
______________________________________________________________________________
CSS
#media all and (min-width: 768px){
.main-content{
flex-direction: row;
overflow: hidden;
}
.thumbnail-list{
flex-direction: column;
margin-left: 20px;
order: 0;
}
.thumbnail-item{
max-width: 260px;
}
.thumbnail-item + .thumbnail-item{
margin-top: 20px;
}
}
Add display:flex; at the top of class thumbnail-list in the css. This should solve the problem. At the moment you don't seem to be telling the css to use flexbox in the first place.
i'm having trouble centering my branding logo vertically in the center. As of right now my rendered html looks like this:
<a class='navbar-brand' href='#'>
<img alt="brand" height="200%" src="/assets/logo.png" />
If I don't set the height to a size, it will be the full size of the png. But my branding isn't vertically center with the rest of my navbar.
My css for the navbar-brand looks like this:
.navbar-default .navbar-brand {
color: #777;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #ffffff;
background-color: transparent;
}
What do I need in my css to make this center with the navbar?
This is the full render of the navbar, pulled right from bootstrap docs.
<nav class='navbar navbar-default' role='navigation'>
<div class='container-fluid'>
<!-- Brand and toggle get grouped for better mobile display -->
<div class='navbar-header'>
<button class='navbar-toggle collapsed' data-target='#bs-example-navbar-collapse-1' data-toggle='collapse' type='button'>
<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='#'>
<img alt="brand" height="200%" src="/assets/logo.png" />
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class='collapse navbar-collapse' id='bs-example-navbar-collapse-1'>
<ul class='nav navbar-nav'>
<li class='active'>
<a href='#'>Link</a>
</li>
<li>
<a href='#'>Link</a>
</li>
<li class='dropdown'>
<a class='dropdown-toggle' data-toggle='dropdown' href='#'>
Dropdown
<span class='caret'></span>
</a>
<ul class='dropdown-menu' role='menu'>
<li>
<a href='#'>Action</a>
</li>
<li>
<a href='#'>Another action</a>
</li>
<li>
<a href='#'>Something else here</a>
</li>
<li class='divider'></li>
<li>
<a href='#'>Separated link</a>
</li>
<li class='divider'></li>
<li>
<a href='#'>One more separated link</a>
</li>
</ul>
</li>
</ul>
<form class='navbar-form navbar-left' role='search'>
<div class='form-group'>
<input class='form-control' placeholder='Search' type='text'>
</div>
<button class='btn btn-default' type='submit'>Submit</button>
</form>
<ul class='nav navbar-nav navbar-right'>
<li>
<a href='#'>Link</a>
</li>
<li class='dropdown'>
<a class='dropdown-toggle' data-toggle='dropdown' href='#'>
Dropdown
<span class='caret'></span>
</a>
<ul class='dropdown-menu' role='menu'>
<li>
<a href='#'>Action</a>
</li>
<li>
<a href='#'>Another action</a>
</li>
<li>
<a href='#'>Something else here</a>
</li>
<li class='divider'></li>
<li>
<a href='#'>Separated link</a>
</li>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
You can try use absolute positioning:
.navbar-brand {
position: absolute;
top: 0;
bottom: 0;
left: 50%;
margin-left: // half the width of your img
}