Bootstrap Footer positioning - html

I know that there are thousands of Topics about Footers but I still cannot ajust mine, I have tryed alot of things but nothing helped..... The footer should be always at the bottom of the page visible only when I scroll down the content.
Hope someone will have any suggestions!
This is my footer:
<div class="wrap">
......
</div>
<div class="footer">
<div class="container">
<div class="col-sm-4">
<img class="menu-icon" src="img/other/user.png"><h11>Account</h11>
<ul class="unstyled">
<li>ddd</li>
<li>ddd</li>
</div>
<div class="col-sm-4">
<img class="menu-icon" src="img/other/gear.png"><h11>Support</h11>
<ul class="unstyled">
<li>ddd</li>
<li>ddd</li>
<li>ddd</li>
<li>ddd</li>
</div>
<div class="col-sm-4">
<img class="menu-icon" src="img/other/share.png"><h11>Share Us</h11>
<ul class="unstyled">
<li><img class="menu-icon" src="img/other/tw.png">Twitter</li>
<li><img class="menu-icon" src="img/other/fb.png">Facebook</li>
<li><img class="menu-icon" src="img/other/gp.png">Google Plus</li>
</div>
</div>
</div>
CSS:
html,
body {
height: 100%;
}
.wrap {
height: auto !important;
min-height: 100%;
}
.footer {
position:absolute;
bottom:0;
width:100%;
height: 140px;
background-color: #222;
}

Check if the below link works with you.
Fiddle
#footer {
position: relative;
background-color: darkcyan;
color: white;
z-index: 1;
}

Im not a 100% sure what your trying to achive. but i suspect that the error might be in your css.
you are currently using:
position:absolute;
And if you want your footer to stick to the bottom of the content, you shouldnt need to manipulate the element to use absolute positioning.
Is this the issue you are facing?
this example is using position:absolute as your code suggests.
https://jsfiddle.net/pvwLu49x/1/
is this what you are trying to do?
https://jsfiddle.net/pvwLu49x/2/

Related

Footer is not at the bottom of the homepage

heres the image of the error I tried several methods on how to align the footer at the bottom but I haven't found any solution what method should I use to solve the problem?
<footer>
<div class="container">
<nav class="footer-nav">
<ul>
<li>About us</li>
<li>Contact</li>
</ul>
</nav>
<nav class="footer-nav">
<ul>
<li>
<a href="#" class="social-link">
<img src="/img/iconmonstr-facebook-2.svg" alt="" />
Facebook
</a>
</li>
<li>
<a href="#" class="social-link">
<img src="/img/iconmonstr-instagram-11.svg" />
Instagram
</a>
</li>
</ul>
</nav>
</div>
</footer>
Add style to the footer element:
style="position:absolute; bottom:0px"
You can use position: absolute as recommended by avi,
But I generally recommend against absolute where possible.
This can be also solved using flexbox.
set the flex-direction to column,
and set flex: 1 on the main part which you want to take all space (generally you don't want the header and footer to expand)
html, body {
height: 100%;
margin: 0;
}
body {
display: flex;
flex-direction: column;
}
header {
background-color: red;
}
main {
flex: 1;
background-color: green;
}
footer {
background-color: blue;
}
<header>Header<</header>
<main>Main</main>
<footer>Footer</footer>
NOTE: you must set the body and html height to 100% in order for that to work.
https://jsfiddle.net/jszht5xp/19/

Position 4 Images Vertically Responisively No Padding

I just want to thank everyone for being so helpful, I would of never learnt so much if it wasn't for your guys continual helpfulness.
I'm trying to make a 4 way vertical "collage" of some images without spaces between each picture that is fully responsive when resizing the window and such. The problem I'm having is with space between each photo; I'm trying to figure out how to allow no space between each.
I also encounter a problem when resizing the window to be smaller in which the images flow away from the lion image above and make more white space or padding without sticking to the lion image. It also starts to overlap the lion image when resizing to a bigger size.
.image {
background-image: url(https://s-media-cache-ak0.pinimg.com/originals/31/91/d7/3191d75f03ba7d4c570358870c855ed7.jpg);
background-repeat: no-repeat;
height: 850px;
background-size: 100%;
}
#collage {
width: 90%;
}
<div class="image">
<ul id="nav">
<li id="brand">MINIMAL</li>
<li id="navm">Men</li>
<li id="navm">Women</li>
<li id="navm">Contact</li>
</ul>
<h1>Simplicity is Minimal</h1>
<div id="home">
Shop Now
</div>
</div>
<div class="row">
<div class="col-md-3" align="center">
<img id="collage" src="https://upload.wikimedia.org/wikipedia/commons/2/27/Panthera_tiger_in_a_marshy_area_in_captivity.jpg">
</div>
<div class="col-md-3" align="center">
<img id="collage" src="https://upload.wikimedia.org/wikipedia/commons/2/27/Panthera_tiger_in_a_marshy_area_in_captivity.jpg">
</div>
<div class="col-md-3" align="center">
<img id="collage" src="https://upload.wikimedia.org/wikipedia/commons/2/27/Panthera_tiger_in_a_marshy_area_in_captivity.jpg">
</div>
<div class="col-md-3" align="center">
<img id="collage" src="https://upload.wikimedia.org/wikipedia/commons/2/27/Panthera_tiger_in_a_marshy_area_in_captivity.jpg">
</div>
</div>
You need to just add below css and I hope it works.-
*{
margin:0px;
padding:0px;
}
.image {
height: auto;
}
body img {
display: block;
}`

Container is not the same height as the child elements

The container is only about 3/4 of the screens height, which is not the same height as the child elements.
Why is that?
I tried to give the container and body a min-height: 100% but this doesn't work. Even with !important
I don't use bootstrap, just plain html and css.
Any help much appreciated!
EDIT: Changing the Body or html height doesn't work. This breaks the page.
I have a body with the following CSS:
body {
background-image: url("../img/1.png");
background-repeat: repeat;
background-size: cover;
font-family: "Raleway", sans-serif;
font-size: 20px;
font-weight: 300;
}
The container has this CSS rules:
.container {
width: 900px !important;
margin: auto;
padding-left: 20px;
padding-right: 20px;
background-color: rgba(255, 255, 255, 0.3);
height: 100% !important;
}
My markup looks like this:
<body>
<div class="container">
<div class="header">
<div class="lang">
<ul class="languages">
<li>DE</li>
<li>FR</li>
</ul>
</div>
<img src="img/header/royalpool.png" alt="" class="logo-royal"/>
<img src="img/header/bluetech.png" alt="" class="logo-bluetech"/>
<div class="lang">
<ul class="languages">
<li>Kontakt</li>
<li>Downloads</li>
<li>Händler</li>
</ul>
</div>
<ul class="navi">
<li>
<div class="box-q-1"><img src="img/header/i/pool.png" alt="" class=header-img/>
<p>Pool</p>
</div>
</li>
<li>
<div class="box-q-1"><img src="img/header/i/filter.png" alt="" class=header-img/>
<p>Filteration</p>
</div>
</li>
<li>
<div class="box-q-1"><img src="img/header/i/des.png" alt="" class=header-img/>
<p>Desinfection</p>
</div>
</li>
<li>
<div class="box-q-1"><img src="img/header/i/cover.png" alt="" class=header-img/>
<p>Cover</p>
</div>
</li>
<li>
<div class="box-q-1"><img src="img/header/i/solar.png" alt="" class=header-img/>
<p>Solar</p>
</div>
</li>
<li>
<div class="box-q-1"><img src="img/header/i/pumpe.png" alt="" class=header-img/>
<p>Wärme-Pumpe</p>
</div>
</li>
<li>
<div class="box-q-1"><img src="img/header/i/led.png" alt="" class=header-img/>
<p>LED</p>
</div>
</li>
<li>
<div class="box-q-1"><img src="img/header/i/clean.png" alt="" class=header-img/>
<p>Clean</p>
</div>
</li>
<li>
<div class="box-q-1"><img src="img/header/i/terasse.png" alt="" class=header-img/>
<p>Terasse</p>
</div>
</li>
</ul>
<div style="clear:both"></div>
</div>
<div class="box-title">
<p>Element-Betonbecken Premium</p>
</div>
<img src="img/page1/pool-top.png" class="pool-img" alt=""/>
<div class="box-small-title-right">
<p>Elementtreppen</p>
</div>
<div class="box-elementtreppen">
<div class="treppe">
<img src="img/page1/eck.png" alt="Eck" class="treppen-img"/>
<p>Ecktreppe</p>
</div>
<div class="treppe">
<img src="img/page1/eck.png" alt="Eck" class="treppen-img"/>
<p>Innen Treppe</p>
</div>
<div class="treppe">
<img src="img/page1/ganz.png" alt="Eck" class="treppen-img"/>
<p>Ganze Treppe</p>
</div>
<div class="treppe">
<img src="img/page1/rom.png" alt="Eck" class="treppen-img"/>
<p>Römische Treppe</p>
</div>
<div class="treppe">
<img src="img/page1/gerade.png" alt="Eck" class="treppen-img"/>
<p>Gerade Treppe</p>
</div>
</div>
<div class="box-small-title-left">
<p>Varianten Wasserstand</p>
</div>
<img src="img/page1/normal.png" alt="" class="img-wasserstand first"/>
<div class="box-small-title-right">
<p>Bauphasen</p>
</div>
<div class="box-bauphasen"></div>
</div>
</body>
The body contains elements that are floated, they need clearing:
.container::before, .container::after {
content: '';
display: table;
}
.container::after {
clear: both;
}
More about understanding floats here: https://css-tricks.com/all-about-floats/
You need to add a height 100% on your body & HTML to make it work.
html, body {
height:100%;
}
You can find more details about this on this same question
try
html,body{
height:100%;
margin:0;
}
You should reset margin and padding as well on html and body.
html, body {
height: 100%;
padding: 0;
margin: 0;
}
Hopefully that'll do it.
If you don't have to support old browsers (IE8 or before) you can achieve what you want setting the height with viewport units:
.container {
height: 100vh;
}
Check the compatibility here: http://caniuse.com/#search=vh
NOTE: If you have any concerns about this you'll have to look for the compatibility of the background-size:cover rule also...
try this it may work:
* {
margin: 0;
padding: 0;
}
html,
body {
min-height: 100%;
}
.container {
height: 100%;
}

trying to resize list items so they are all equal size

I am trying to make my list items all the same width. I've tried setting the widths in the css and nothing changes. Can anyone figure this out?
Here is an image to show what I am talking about:
HTML:
<body>
<div class="content-wrapper" id="container">
<header>logo
<nav>navigation</nav>
</header>
<div class="clear-fix"></div>
<div id="body">
<section class="main-content">
<section class="leftPane">
<h2>Categories</h2>
</section>
<section class="rightPane">
<div class="checkout">
<h1>Checkout</h1>
<ul class="steps">
<li><a href="http://localhost:59213/Cart">
<div id="step0" class="arrow_box_grey">
Shopping Cart</div>
</a>
</li>
<li><a href="http://localhost:59213/Cart/Student">
<div id="step1" class="arrow_box_grey">
Student</div>
</a>
</li>
<li><a href="http://localhost:59213/Cart/Delivery">
<div id="step2" class="arrow_box_grey">
Delivery</div>
</a>
</li>
<li>
<div id="step3" class="arrow_box_green">Payment</div>
</li>
<li>
<div id="step4" class="arrow_box_blue">Finish</div>
</li>
</ul>
</div>
</section>
<div class="clear-fix"></div>
</section>
</div>
</div>
And here if my fiddle with the code: http://jsfiddle.net/M74Em/
You need to change this style:
.main-content .checkout ul.steps li div {
display: inline;
width: 1000px;
}
You can't set widths for inline elements so try this:
.main-content .checkout ul.steps li div {
display: inline-block;
width: 100px;
}
Example
From twBootstrap, applied to <ul>'s (demo):
.ul-justified {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}
.ul-justified > li {
display: table-cell;
float: none;
width: 1%;
}
and slap .ul-justified to any ul-list you want aligned, and you get equal width <li>'s automatically fit parent ul's width.

Divs don't merge

I have this layout:
I am trying to make the div with a slideshow, this above the red thing, be above the section of header.
I tried z-index, and a lot of other ways, but cannot get the layout to work.
This is my code:`
<div id="box">
<div class="clear"></div>
<div id="slideshow">
<ul>
<li>
<img src="imagens/1.png" alt="Curso 1" class="banner" />
</li>
<li>
<img src="imagens/2.png" alt="Curso 2" class="banner" />
</li>
<li>
<img src="imagens/3.png" alt="Curso 3" class="banner" />
</li>
<li>
<img src="imagens/4.png" alt="Curso 4" class="banner" />
</li>
</ul>
</div>
<div class="clear"></div>
<div id="header">
<div id="logo">
<img src="imagens/logo.png" id="" />
</div><!--logo-->
<div id="menu">
<ul>
<a class=""><li>HOME</li></a>
<a class=""><li>PROGRAMAÇÃO</li></a>
<a class=""><li>PALESTRANTES</li></a>
</ul>
</div>
</div><!--header-->
</div>
And this CSS:
.clear {
clear: both;
}
#box {
width:980px;
margin: 0 auto;
background-color:red;
}
#header {
z-index: 3;
}
#slideshow {
height:286px;
width:980px;
z-index: 0;
float: right;
}
#slideshow ul {
list-style: none;
}
#slideshow img {
overflow: hidden;
height:286px;
width:980px;
}
What can I do to solve this?
I'm trying to do something like this:
I think by "merge" you mean overlap.
To make the logo and navigation (#header) overlap the slideshow (#slideshow) above it, you will need to put a negative top margin on #header. You also need to add position to an element in order for z-index to work.
#header {
position:relative;
z-index: 3;
margin-top:-200px;
}
Once you do this, you may need to increase the z-index property of #header in order for it to get to overlap your slideshow.