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.
Related
Fiddle here: https://jsfiddle.net/mv5ut6sw/
I have a list of links at the top of my webpage contained in a <div>. I would like a horizontal <hr> line above and below this <div> to visually separate the links from the rest of the page. Simplified example:
<hr>
<div style="float:left; width:100%">
<div style="float:left; margin-right:20px">
<ul>
<li>Link1</li>
<li>Link2</li>
</ul>
</div>
<div style="float:left; margin-right:20px">
<ul>
<li>Link3</li>
<li>Link4</li>
</ul>
</div>
</div>
<hr>
I am using bootstrap to pretty the page up. Without bootstrap, the <hr>s behave as expected, appearing above and below the link section. When I use bootstrap, however, the two horizontal lines both appear above the link section.
I am at a loss. I don't want to edit bootstrap code. Is there inline css I can include to fix this weird placement?
Its because floats take the elements out of the flow...either you can clear the float value clear:both or by applying overflow:hidden in the parent div...
Well If you are using bootstrap4 then why use floats...just Use d-flex class on the parent div
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.js"></script>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<body>
<h3 style="background-color: lightgray; height: 40px; padding: 2px">
Ye old title
</h3>
<hr>
<div class="d-flex">
<ul>
<li>Race Entry</li>
<li>Start</li>
<li>Position Transfer</li>
<li>Contracts</li>
</ul>
<ul>
<li>Statements</li>
<li>Race Position</li>
<li>Advertising Firm</li>
</ul>
<ul>
<li>Report1</li>
<li>Report2</li>
</ul>
<ul>
<li>Settle it!</li>
<li>Upload</li>
<li>Search</li>
</ul>
</div>
<hr>
</body>
"Is there inline css I can include to fix this weird placement?"
It's because of the floats. Just clear the last <hr>..
<hr style="clear:both;">
https://jsfiddle.net/s9L0Lf9b/
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<body>
<h3 style="background-color: lightgray; height: 40px; padding: 2px">
Ye old title
</h3>
<hr>
<div style="float:left; width:100%;">
<div style="float:left; margin-right:20px">
<ul>
<li>Race Entry</li>
<li>Start</li>
<li>Position Transfer</li>
<li>Contracts</li>
</ul>
</div>
<div style="float:left; margin-right:20px">
<ul>
<li>Statements</li>
<li>Race Position</li>
<li>Advertising Firm</li>
</ul>
</div>
<div style="float:left; margin-right:20px">
<ul>
<li>Report1</li>
<li>Report2</li>
</ul>
</div>
<div style="float:left; margin-right:20px">
<ul>
<li>Settle it!</li>
<li>Upload</li>
<li>Search</li>
</ul>
</div>
</div>
<hr style="clear:both;">
</body>
"The float CSS property specifies that an element should be taken from
the normal flow and placed along the left or right side of its
container, where text and inline elements will wrap around it." __ from MDN posted on a related question
P.S. - There's no need to use floats with Bootstrap 4.
I have some troubles with my footer on a website. Footer is not displaying at the bottom of the page but it starts right below the header and covers elements that are under it. For better understanding I made fiddle for it and screenshot
But its like this:
<div class="mens">
<div class="main">
<div class="wrap">
<div class="section group">
<div class="cont span_2_of_3">
<h2 class="head">PRIPOROČAMO</h2>
<div class="top-box">
and then there are some products and then there are the end divs for this:
</div>
</div>
</div>
</div>
</div>
</div>
And then follows the footer:
<footer class="footer-2 bg-midnight-blue">
<div class="container">
<nav class="pull-left">
<ul>
<li class="active">
Home
</li>
<li>
Company
</li>
<li>
Portfolio
</li>
<li>
Blog
</li>
<li>
Contact
</li>
</ul>
</nav>
<div class="social-btns pull-right">
<div class="fui-vimeo"></div><div class="fui-vimeo"></div>
<div class="fui-facebook"></div><div class="fui-facebook"></div>
<div class="fui-twitter"></div><div class="fui-twitter"></div>
</div>
<div class="additional-links">
Be sure to take a look to our Terms of Use and Privacy Policy
</div>
</div>
</footer>
And I know its a lot of code but I would really appreciate if someone could look at it. Thanks.
use this to reset ur css
.clearfix:before,.clearfix:after{content: '.';display: block;overflow: hidden;visibility: hidden;font-size: 0;line-height: 0;width: 0;height: 0;clear: both;}
.clearfix {overflow: auto;zoom: 1;}
and add clearfix class in parent div where in child u have used float like in
<div class="page-wrapper clearfix">
<div class="main clearfix">
<footer class="footer-2 bg-midnight-blue clearfix">
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.
I am using bootstrap to build my site and in one location I have two divs stacked on top of each other to the right of an image. The two divs should each be half the height of the image as long as the browser is over 767px and be responsive as well.
Here is a jsfiddle: http://jsfiddle.net/dC7z5/
<div class='row subhead'>
<div class='col-sm-9'>
<img src="http://placekitten.com/900/554" class="img-responsive" />
</div>
<div class='col-sm-3'>
<div class='row'>
<div class='col-sm-12 services'>
<p>Services</p>
<ul>
<li>first service</li>
<li>another service</li>
</ul>
</div>
</div>
<div class='row'>
<div class='col-sm-12 specs'>
<p>Tech Specs</p>
<ul>
<li>one spec</li>
<li>second spec</li>
</ul>
</div> <!-- end specs -->
</div>
</div>
</div>
Here's an image of what I'm trying to do: http://laurenpittenger.com/here/wp-content/uploads/2014/01/Screen-Shot-2014-01-05-at-4.46.31-PM.png
Create a div container that contains both the Service box, and the Tech Specs Box. Then, in the css, make the container the same height as the image. Do this to the Service and Tech Specs Box:
height:50%;
I'm stuck with the CSS of following HTML link and want to expand the height of header image so I can adjust larger with it, but when I play with the CSS of the .header & .logo classes it expands the navigation bar also, I just really need to expand the height of the header image to have larger height logo into it.
Looking your html source seems you can have different solutions. Problem is with your html... You have
<div class="navigation">
inside
<div class="container">
Ans : get navigation div out of container div. Then changing the height of container div would be the best and not affect the height of your links.
Why you are getting problem : your header div is containing links inside it. That is why changing the height of header is not good (It simply changes the overall height of this div).
Update : Reply to your first comment on my answer
<div class="inner">
<div class="container">
<!-- Logo Start -->
<div class="five columns left">
<img src="images/logo.png" alt="" />
</div>
<!-- Logo End -->
<div class="eleven columns right">
<!-- Top Links Start -->
<ul class="top-links">
<li>
<h4 class="colr">Search Music</h4>
<div id="search-box">
<input name="" value="Enter any keyword"
onfocus="if(this.value=='Enter any keyword') {this.value='';}"
onblur="if(this.value=='') {this.value='Enter any keyword';}" type="text" class="bar" />
<button>Search</button>
</div>
</li>
<li>
LOG IN
<div id="login-box">
<h4 class="white backcolr">User Login </h4>
<ul>
<li>
<input name="" value="yourname#email.com"
onfocus="if(this.value=='yourname#email.com') {this.value='';}"
onblur="if(this.value=='') {this.value='yourname#email.com';}" type="text" class="bar" />
</li>
<li>
<input name="" value="password"
onfocus="if(this.value=='password') {this.value='';}"
onblur="if(this.value=='') {this.value='password';}" type="password" class="bar" />
</li>
<li>
<input type="checkbox" class="left" />
<p>Remember me</p>
Forget Password?
</li>
<li>
<button class="backcolrhover">Login</button>
</li>
</ul>
<div class="clear"></div>
</div>
</li>
</ul>
<!-- Top Links End -->
</div>
<div class="clear"></div>
</div>
<!-- Container End -->
<!-- Navigation Start -->
<div class="navigation">
<div id="smoothmenu1" class="ddsmoothmenu">
<ul id="nav">
<li class="current-menu-item">Home</li>
<li>NEWS</li>
<li>Albums
<ul>
<li>Albums</li>
<li>Album Detail</li>
</ul>
</li>
<li>Blog
<ul>
<li>Blog</li>
<li>Blog Detail</li>
</ul>
</li>
<li>Gallery
<ul>
<li>Gallery - Two Column</li>
<li>Gallery - Three Column</li>
<li>Gallery - Four Column</li>
<li>Gallery - Slide Show</li>
</ul>
</li>
<li>About Us</li>
<li>Contact Us</li>
<li>BUY THIS THEME</li>
</ul>
<div class="clear"></div>
</div>
</div>
<!-- Navigation End -->
</div>
Then change your css and see the results
.container {
width:100%;
height:100px; /* I have changed it 50px to 100px*/
float:left;
margin-top:2px;
}
Change your header height here :
#header {
width:100%;
height:148px; <-----------Here
float:left;
position:relative;
z-index:2;
margin-bottom:15px;
box-shadow:0px 2px 2px #000;
background:url(../images/header.gif) repeat-x;
}
Edit: I just inspected with firebug, you are using multiple classes and you've nested div's, your logo div lies here
five columns left
I guess you've picked this template and you are trying to edit it right?