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;.
Related
White row appeared below main menu and above jumbotron on a drupal site. I am unable to remove it.
I think that it is css problem but I can't find what exactly causing it. Here is the link to codepen: https://codepen.io/lomachx/pen/WNbLgYa
<body class="html front not-logged-in no-sidebars page-node i18n-ru">
<div id="skip-link" class="skip-link">
Skip to main content
</div>
<div class="menu-wrap">
<div class="full-wrap logo-wrap"><!--c-->
<div id="logo">
<img src="img/logo.png"/>
</div>
<h1 id="site-title">
Cool Site
</h1>
<nav id="main-menu" role="navigation">
<a class="nav-toggle" href="#">Navigation</a>
<div class="menu-navigation-container">
<ul class="menu"><li class="first leaf">Main</li>
<li class="leaf">Articles</li>
<li class="last leaf">About</li>
</ul>
</div>
</nav>
</div>
</div>
<div class="header"><!--c-->
<div class="homebanner">
</div>
<!--New navbar -->
<div>
<nav class="navbar-lower" role="navigation">
<div class="region region-second-menu">
<div id="block-system-navigation" class="block block-system block-menu">
<div class="content">
<ul class="menu">
<li class="first last leaf">Главная</li>
</ul>
</div>
</div> <!-- /.block -->
</div>
</nav>
</div>
</div>
<div class="bckgr-wrap">
<div><H1>Nest</H1></div>
</div>
</body>
</html>
Change body margin-top:50px to the height of your header like below
css
body {
color: #333;
background: #fff;
background-size: cover;
font-family: 'Philosopher', sans-serif;
font-size: 14px;
line-height: 180%;
margin-top: 35px;
}
I am building a webpage with HTML & CSS, using the bootstrap framework. It is based on the grid layout system. I would like to have my navbar and first row of my grid in a group and the second row in a group, where each group fills 100% of the screen height. I can't see how a div definition would work as it spans the middle of two div classes. I have tried this, using the calc function, but it doesn't seem to be working.
Here is a JSFiddle. (NB: try expanding the output window to show the problem properly)
<div class="PageView">
<nav class="navbar navbar-default">
<div class="container-fluid" id="logoStripe">
<!-- Brand and toggle get grouped for better mobile display -->
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="defaultNavbar1">
<ul class="nav navbar-nav links">
<li>About<span class="sr-only">(current)</span>
</li>
<li>Pre-Order
</li>
<img src="Images/Logo.png" alt="Logo" style="width:auto; height:75px; padding-top:5px; padding-bottom:5px;">
<li>News
</li>
<li>Contact Us
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<div class="container-fluid">
<div class="PageView">
<div class="row">
<div class="col-md-12">.col-md-1</div>
</div>
<div class="row">
<div class="col-md-6">Button 1 (align Right)</div>
<div class="col-md-6">Button 2 (align Left)</div>
</div>
</div>
</div>
and the CSS:
.links {
width: 100%;
display: flex;
justify-content: space-between;
font-size: 28px;
color: #FFFFFF;
}
#logoStripe {
background-color: #54534a;
}
.PageView {
height: calc(100% - 75px);
}
Can anyone see what I have done wrong? Any ideas would be much appreciated.
Percentage heights calculate from their parents height so you have to start from the most parent element and cascade it down to the element you want with the modified height. You also have two divs with .PageView that cannot use the same CSS to work properly; I'm not sure if this was done on purpose.
Also, if you are using calc, you will need to adjust the pixel amount for each of Bootstrap's breakpoints.
html, body, .PageView {
height:100%;
}
.links {
width: 100%;
display: flex;
justify-content: space-between;
font-size: 28px;
color: #FFFFFF;
}
#logoStripe {
background-color: #54534a;
}
.adjustedHeight {
height: calc(100% - 77px);
background-color:red; /* For emphasis */
}
.PageView .navbar {
margin:0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>
<div class="PageView">
<nav class="navbar navbar-default">
<div class="container-fluid" id="logoStripe">
<!-- Brand and toggle get grouped for better mobile display -->
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="defaultNavbar1">
<ul class="nav navbar-nav links">
<li>About<span class="sr-only">(current)</span>
</li>
<li>Pre-Order
</li>
<img src="Images/Logo.png" alt="Logo" style="width:auto; height:75px; padding-top:5px; padding-bottom:5px;">
<li>News
</li>
<li>Contact Us
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<div class="container-fluid adjustedHeight">
<div class="PageView2">
<div class="row">
<div class="col-md-12">.col-md-1</div>
</div>
<div class="row">
<div class="col-md-6">Button 1 (align Right)</div>
<div class="col-md-6">Button 2 (align Left)</div>
</div>
</div>
</div>
I having problems trying to centralize a bootstrap standard nav in a row.
<footer id="page_footer">
<div class="container">
<div class="row">
<div class="col-md-8">
<ul id="page_footer_links" class="nav nav-pills nav-center">
<li role="presentation">Home</li>
<li role="presentation">Profile</li>
<li role="presentation">Messages</li>
</ul>
</div>
<div class="col-md-4">
<p id="page_footer_wordpress" class="text-center">Orgulhosamente movido com WordPress!!!</p>
</div>
</div>
</div>
Here the complete fiddle: http://jsfiddle.net/vpontin/bkpnrLo0/
I tried putting text-center and center-block. None worked. Even putting margin 0 auto or text-align: center didn't work.
What i need to do?
The .nav-pills list items have default floating behavior to left. So change it to none and display them in one line using display: inline-block.
Updated JSfiddle
#page_footer {
background-color: #f5f5f5;
width: 100%;
}
#page_footer .container {
padding: 20px;
}
#page_footer_links {
margin: 0 auto;
text-align: center;
}
#page_footer_wordpress {
margin: 0px;
height: 40px;
line-height: 40px;
}
.nav-pills > li {
float: none !important;
display: inline-block !important;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<footer id="page_footer">
<div class="container">
<div class="row">
<div class="col-md-8">
<ul id="page_footer_links" class="nav nav-pills nav-center">
<li role="presentation">Home
</li>
<li role="presentation">Profile
</li>
<li role="presentation">Messages
</li>
</ul>
</div>
<div class="col-md-4">
<p id="page_footer_wordpress" class="text-center">Orgulhosamente movido com WordPress!!!</p>
</div>
</div>
</div>
I have the following HTML:
<nav class="navbar pr-navbar navbar-fixed-top" role="navigation">
<div class="navbar-header">
<div class="row">
<div class="navbar-left">
<a plat-tap='goBack()'><span class="fui-arrow-left pr-back"></span></a>
</div>
<div class="navbar-right">
<a plat-tap='goHome()'><span class="glyphicon glyphicon-home pr-home"></span></a>
</div>
<p class="pr-navbar-text">Manage/Add Users</p>
<div class="navbar-right">
<div class="pr-add-item">
<a plat-tap='addUser()'><span class="fui-plus"></span></a>
</div>
</div>
</div>
</div>
</nav>
Coupled with the following LESS:
#primaryColor: red;
#secondaryColor: blue;
#borderColor: white;
#textColor: white;
.pr-back{
color: #textColor;
}
.pr-home{
color: #textColor;
}
.pr-navbar-text{
color: #textColor;
text-align: center;
}
.pr-navbar {
background-color: #secondaryColor;
background-image: none;
background-repeat: no-repeat;
filter: none;
}
body { padding-top: 75px; }
#media screen and (max-width: 768px) {
body { padding-top: 53px; }
}
.pr-add-item {
padding-right: 75px
}
For some reason, the row element in my HTML does nothing. The plus icon is always put on a row beneath all the other buttons. How can I fix this so I have one row with a left aligned button, a center text, and two right aligned buttons?
Here, I started a fiddle for this.
JSFiddle here
<nav class="navbar pr-navbar navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="nav navbar-nav navbar-left">
<a plat-tap='goBack()'><span class="fui-arrow-left pr-back"></span></a>
</div>
<div class="nav navbar-nav navbar-right">
<a plat-tap='goHome()'><span class="glyphicon glyphicon-home pr-home"></span></a>
</div>
<p class="nav navbar-nav pr-navbar-text">Manage/Add Users</p>
<div class="nav navbar-nav navbar-right">
<div class="pr-add-item">
<a plat-tap='addUser()'><span class="glyphicon glyphicon-plus"></span></a>
</div>
</div>
</div>
</nav>
This HTML is closer to what you want. There were some unnecessary tags included in your original HTML, and also some important tags (like nav and navbar-nav) that were excluded. I suggest you read over this section of the bootstrap components page to understand how to get NavBars to work more cooperatively.
(I changed the glyph for your plus button and back arrow button so something would show up without including flat ui).
Edit: Altered the JSFiddle so that the text could be centered in the navbar.
I have some problem in bootstrap, I develope website but after completation of website client say they dont want to responsive website.
So, I first fix the .container width to 960px !important;
It will works..!! But Problem is I am also using .row class every where row class is making responsiveness which its contains..
I want 100% width background at footer but when I resize browser & scroll horizontally it will removes the background color.
What can I do...
See Website : Snapshot 1
When browser resize then see Whats the problem occure : Snapshot 2
my html code is written in bootstrap 3 :
<footer>
<div class="row footercolor">
<div class="container">
<div class="row">
<div class="col-xs-2 ">
<div class="row">
<h5 class="undr footertitle">Lorem Ipsum</h5>
</div>
</div>
<div class="col-xs-3">
<div class="row">
<h5 class="undr footertitle">QUICK LINKS</h5>
<div class="col-xs-6">
<ul class="footerlist list-group">
</ul>
</div>
<div class="col-xs-6">
<ul class="footerlist list-group">
</ul>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="row">
<h5 class="undr footertitle">OUR NEIGHBORHOODS</h5>
<div class="col-xs-6">
<ul class="footerlist list-group">
</ul>
</div>
<div class="col-xs-6">
<ul class="footerlist list-group ">
</ul>
</div>
</div>
</div>
<div class="col-xs-3">
<div class="row">
<h5 class="undr footertitle">GET WEEKLY LISTING UPDATES</h5>
<div class="input-group">
<input type="text" class="form-control">
<span class="input-group-addon btn-ftrbtn">Add Me</span>
</div>
</div>
<div class="row"><br/></div>
<div class="row">
<ul class="list-unstyled list-inline pull-right">
<li><img src="img/fb.png"></li>
<li><img src="img/twitter.png"></li>
<li><img src="img/pintrest.png"></li>
</ul>
</div>
</div>
</div>
</div>
</div> <!-- /container -->
</footer>
& My CSS Code is :
.footercolor {
background-color: #5e6872;
}
.footer{color:#c6c6c9}
.footertitle {
font-family: 'myriad_prosemibold_condensed' !important;
font-size: 13px!important;
color: #fff !important;
letter-spacing: 0.5px;
}
.footerlist li a {
font-family: 'myriad_prolight_semicondensed' !important;
font-size: 12px!important;
color: #c6c6c9 !important;
text-decoration: none
}
.footerlist li a:hover {
color: #fff !important;
cursor: pointer
}
.row {
margin-left: 0 !important;
margin-right: 0 !important;
}
.container{min-width:960px !important;}
At the last Please Give me solution for that...
Any Help will be appreciated...
Add the below code to your CSS file will fix the issue.
html, body {
min-width:960px;
}
You have incorrect markup for bootstrap mate....
Use container > row > span
Instead of :
<div class="row footercolor">
<div class="container">
Order should be :
<div class="container footercolor"> <!-- notice the reverse order now -->
<div class="row ">