Align logo in the middle between menus (foundation framework) - html

been trying to align the logo in the middle between menus trying to make it using foundation zurb.
something like [menu1] [menu2] --[logo]-- [menu3] [menu4].
Sure it might work using the grid system:
<div class="panel hide-for-small-down">
<div class="row">
<div class="large-4 columns">
<nav>
<ul>
<li>About</li>
<li>Portfolio</li>
</ul>
</nav>
</div>
<div class="large-4 columns">
<img src="http://placehold.it/350x150">
</div>
<div class="large-4 columns">
<nav>
<ul>
<li>Blog</li>
<li>Contact</li>
</ul>
</nav>
</div>
</div>
</div>
Haven't tried any CSS yet apart from this simple one, don't mind the top-nav class but.
ul li{
list-style: none;
display: inline-block;
padding: 15px;
background: #ccc;
}

I would use display: inline-block and vertical-align: middle
DEMO http://jsfiddle.net/AA49p/1/
.large-4 {
display: inline-block;
vertical-align: middle;
}

Your are having this problem because Foundation grid columns have a certain width which does not depend on the content.
Currently you logo is actually exactly in the center, but of course it doesn't look like it is. That's because the content is justified to the left and your navs are much narrower than their parents ("large-4"s)
It's easier to show.
You will find that this code brings you much closer the desired result:
<div class="panel hide-for-small-down">
<div class="row">
<div class="large-3 columns">
<nav>
<ul>
<li>About</li>
<li>Portfolio</li>
</ul>
</nav>
</div>
<div class="large-5 columns">
<img src="http://placehold.it/350x150">
</div>
<div class="large-4 columns">
<nav>
<ul>
<li>Blog</li>
<li>Contact</li>
</ul>
</nav>
</div>
</div>
All I did was change the first column to "large-3" and the second to "large-5".
Now it looks like it is centered.
May be this result will satisfy you. But know that it's just not the best way to center a logo using grid-columns.
Another easy solution is to "float: right" the right nav.

Related

Placing spaces between links in sidebar-nav bootstrap4

I designed a sidebar with links and am trying to give space between each of the links ive tried adding
.sidebar-nav>li>a{ padding-bottom: 500px; }
its not adjusting what alternative can be used to adjust this see full code below...
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2">
<ul class="navbar sidebar-nav">
<li class="active">Reports</li>
<li>Reports</li>
<li>Reports</li>
</ul>
</div>
<div class="col-sm-9 col-md-10"></div>
</div>
</div>
don´t know if it's the solution you're looking for, but adding a:
</br>
before the
<li>
adds a space before the next line. try it!

Row extending outside of it's container

I have this weird problem with my bootstrap row and I can't figure it out..
If you take a look at this image you see that my row is extending outside of my container fluid for some reason. I applied only one style to container fluid which is max-width: 1600px and padding:0. However, I don't think this is the problem.
Here's how I have my footer structured. As I said, no extra styles applied to the .row itself..
<!-- Start Footer area -->
<div class="container-fluid">
<div class="row">
<h3>Quick Links</h3>
<div class="col-xs-4">
<ul>
<li><a class="register-link" href="#"><button class="footer-register-btn" type="button">Register</button></a></li>
<li>About</li>
</ul>
</div>
<div class="col-xs-4">
<ul>
<li>Terms of Service</li>
<li>Privacy Policy</li>
</ul>
</div>
<div class="col-xs-4">
<ul>
<li>Contact</li>
<li>FAQ</li>
</ul>
</div>
</div>
<hr class="hr-devider">
<p class="copyright">Copyright © 2016. All Rights Reserved. Proiect de licenta</p>
</div>
<!-- End Footer area -->
Ok, I figure it out.. The problem was with the fact that I had no padding on the container-fluid. After I added some left and right padding it worked.

Vertical alignment does not work in Bootstrap

I'm trying to vertically center the menu links of my header, but does not work. I'm using Bootstrap.
HTML
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 header">
<div class="row">
<div class="col-xs-1"></div>
<div class="col-xs-2" style="font-size: 40px;">
<p>Capelli</p>
</div>
<div class="col-xs-3"></div>
<div class="col-xs-6">
<ul class="list-group list-inline">
<li>Vestidos</li>
<li>Meus Pedidos</li>
<li></li>
<li></li>
<li>Login</li>
<li>Cadastro</li>
<li></li>
<li></li>
<li>Carrinho</li>
</ul>
</div>
<div class="col-xs-1"></div>
</div>
</div>
</div>
</div>
CSS
body {
background-color: #CFCFCF;
}
.header {
min-height: 3.7em;
color: #FFFFFF;
background-color: #002A43;
font-family: Arial, sans-serif;
font-size: 20px;
}
.vertical {
float: none;
display: inline-block;
vertical-align: middle;
}
When a run the code, nothing happens.
I've tried many things, like use the class directly in row or in col-, but nothing work. I also trie diferent methods to align vertically, but did not work.
P.S.: Sorry for my bad english.
You want to create a nav bar menu?
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Capelli</a>
</div>
<div>
<ul class="nav navbar-nav push-right">
<li class="active">Vestidos</li>
<li> etc</li>
<li>etc</li>
<li>etc</li>
</ul>
</div>
</div>
</nav>
in css you shoud define the font-size of X pixels, because you are using relative font-size.
its 3.7em of 10px or 20px. depending the browser the value can change.
html{ font-size: 16px;}
.header{font-size: 1.25em; // 20/16 = 1.25 and you have sure the font size is relative to 16 because you have define html font size to 16px;.

List items are not filling width of the ul

I have a list that I want to fill the width of the container but there seems to be a small gap at the end for some reason.
The CSS is lengthy so here is the html
<div class="line clearfix no-margin">
<div class="container">
<header>
<div class="logo col-4">
<img src="#" />
<h1 class="logo">Name</h1>
</div>
<div class="nav clearfix">
<ul>
<li><span id="head-icon"></span>About Us</li>
<li><span id="wrench-icon"></span>Services</li>
<li><span id="email-icon"></span>Contact</li>
</ul>
</div>
</header>
</div>
</div>
Demo
I can't seem to figure out where that gap is coming from.
It's because of the margin-left: -3px; in .nav li!
See the updated Fiddle: http://jsfiddle.net/VRtnA/18/
Try removing margin-left: -3px; in .nav li.

split a sidebar into two

I hope you can all help :)
I have a sidebar on my website but because I don't want it going under the fold I would like to split this ten li sidebar into two 5 li sidebars with a div inbetween them showing content using Jquery. I have coded up the website so it looks good but I need the sidebars to act as one menu instead of two so only one selection can be made at a time , one current class etc. Anyone know how to do this? My mark-up is as follows:
<div id="sidebar">
<ul class="list2"><em>
<li class="current1">Bilgorajski</li>
<li>Rzeszowski</li>
<li>Kasuby</li>
<li>Mazur</li>
<li>Lubelski</li>
</em>
</ul>
</div>
<div id="repcontent">
</div>
<div id="sidebar">
<ul class="list2"><em>
<li>Powislainski</li>
<li>Podhalainski</li>
<li>Kujuwiak Oberek</li>
<li>Krakowiak</li>
<li>Szlansk</li>
</em>
</ul>
</div>
You just have to remove tags that commented in the following code:
<div id="sidebar">
<ul class="list2"><em>
<li class="current1">Bilgorajski</li>
<li>Rzeszowski</li>
<li>Kasuby</li>
<li>Mazur</li>
<li>Lubelski</li>
</em>
</ul>
<!-- </div> -->
<div id="repcontent">
</div>
<!-- <div id="sidebar"> -->
<ul class="list2"><em>
<li>Powislainski</li>
<li>Podhalainski</li>
<li>Kujuwiak Oberek</li>
<li>Krakowiak</li>
<li>Szlansk</li>
</em>
</ul>
</div>
Edited: To get three columns layout, I will use zurb-foundation CSS framework as follows:
<body>
<div id="header" class="row">
<div class="twelve columns">
Header
</div>
</div>
<div class="row">
<div id="left-sidebar" class="three columns">
<ul class="list2"><em>
<li class="current1">Bilgorajski</li>
<li>Rzeszowski</li>
<li>Kasuby</li>
<li>Mazur</li>
<li>Lubelski</li>
</em>
</ul>
</div>
<div id="repcontent" class="six columns">
Middle contents
</div>
<div id="right-sidebar" class="three columns">
<ul class="list2"><em>
<li>Powislainski</li>
<li>Podhalainski</li>
<li>Kujuwiak Oberek</li>
<li>Krakowiak</li>
<li>Szlansk</li>
</em>
</ul>
</div>
</div>
</body>
take it easy.. use
-webkit-column-count: 2;
this will splits your contents into two columns..Or if you want to display the sidebars in two sides separately then use 2 separate divisions and float:left|right; property. Or you can query for this using JQuery.
<body>
<div class="container">
<div class="sidebar1">
<ul class="nav">
<li>Link one</li>
<li>Link two</li>
<li>Link three</li>
<li>Link four</li>
</ul>
<p> </p>
<!-- end .sidebar1 --></div>
<div class="content">
<!-- end .content --></div>
<div class="sidebar2">
<!-- end .sidebar2 --></div>
<!-- end .container --></div>
</body>
css
.sidebar1 {
float: left;
width: 20%;
background-color: #93A5C4;
padding-bottom: 10px;
}
.content {
padding: 10px 0;
width: 60%;
float: left;
}
.sidebar2 {
float: left;
width: 20%;
background-color: #93A5C4;
padding: 10px 0;
}
Try this code. this may clarifies your problem .