Make a div full screen like a background - html

I have the following:
http://jsfiddle.net/B6dFk/embedded/result/
Excerpts:
HTML:
<div id="aboutback">
This is a background
</div>
<div id="workback">
This is another background
</div>
<div id="wrapper">
<div id="innerwrapper">
<div id="nav">
<div id="about" class="menu1">
<p>About</p>
</div>
<div id="aboutsub">
<div id="team" class="menu2">
<p>Team</p>
</div>
<div id="experience" class="menu2">
<p>Experience</p>
</div>
<div id="difference" class="menu2">
<p>Difference</p>
</div>
</div>
<div id="work" class="menu1">
<p>Work</p>
</div>
<div id="worksub">
<div id="services" class="menu2">
<p>Services</p>
</div>
<div id="ourprocess" class="menu2">
<p>Our Process</p>
</div>
</div>
<div id="portfolio" class="menu1">
<p>Portfolio</p>
</div>
<div id="contact" class="menu1">
<p>Contact</p>
</div>
</div>
<div id="outerviewer">
<div id="innerviewer">
<p>
Filler
</p>
</div>
</div>
</div>
CSS
#aboutback
{
position: absolute;
background: #11ac92;
min-height: 100%;
width: 100%;
top: 0;
z-index: -1;
}
I want the #aboutback and the #workback to take up the full background at all times. These will have images in them which i will animate using jquery.
The problem is, when the window isn't full page(so the scrollbar appears) and you scroll down, you see the white nothingness of despair.
It's worth noting I have tried setting the position of the body tag which alters the effect but does not fix it. For example, position:absolute; will push everything left and leave a white space on the right.
Any simple solutions, please?

body{
height:100%;
overflow:hidden;
}

html{height:100%;}
body{height:100%;}
divclass{height:100%;}

Related

Unnecesary height of html page

my html page has this unwanted white patch in the bottom and I don't know why. I don't want to be able to scroll down that long. It stays there regardless by default. it dissapears when I hover on the left(front) element but reappears when I hover on the right(behind) element.
here is the codepen : https://codepen.io/aronnora/pen/ExjJrag
<nav class="nav_bar">
<img src="580b57fcd9996e24bc43c4f8.png" alt="logo" class="logo" id="logo">
<div class="trans" id="trans"> trans energy solutions </div>
<ul class="ul">
<li class="li1">Home</li>
<li class="li2">About Us</li>
<li class="li3">Products</li>
<li class="li4">Services</li>
<li class="li5">Facility</li>
<li class="li6">Testing</li>
<li class="li7">Clients</li>
<li class="li8">Contact</li>
</ul>
</nav>
<div class="white">
</div>
<div class="pro">
<div class="text">
PRODUCTS
</div>
</div>
<div class="total">
<div class="one">
<img src="liquid-immersed-distribution-transformers-768x784.png" alt="kakashi" class="Kakashi" height="300rem"></img>
<div class="downtextone">
時メユ郎護ヲテ写藤くクッル起稲ロチ製資ヌ米更ナ池天ワア由時テ栃94探容ケニ災逮はぴ氷可難智む。能ざラくな静盟ごぼじ不注更ルモト点究サトケ別意マワ抜博写ミ元
</div>
</div>
<div class="two">
<img src="transtech-2.png" alt="madara" class="Madara" height="300rem"></img>
<div class="downtexttwo">
時メユ郎護ヲテ写藤くクッル起稲ロチ製資ヌ米更ナ池天ワア由時テ栃94探容ケニ災逮はぴ氷可難智む。能ざラくな静盟ごぼじ不
</div>
</div>
</div>
your div takes a default height as it's content. so just add overflow:hidden; to class (.tow)
.two {
height: 58.29rem;
width: 45rem;
transition: opacity 1s;
background-color: black;
position: absolute;
z-index: 10;
overflow: hidden;
}

Responsive layout not scrolling vertically in short screens

I have a site I designed and coded that seems to cut off top and bottom on very specific devices that have short screens AND WILL NOT SCROLL. Any ideas on that I can do to keep the picture centered in the browser without any overlapping
Here's a link to jsfiddle:
https://jsfiddle.net/SCATORY/mjyssu7y/
<body>
<div id="container">
<div class="container">
<div class="nav">
<div class="logo"></div>
</div>
</div>
<div class="container holder">
<div class="center">
<div class="height">
<h1>Practice yoga. <br>In hypo-microbial style.</h1>
</div>
<div class="bag">
</div>
<div class="height-2">
<h2>Introducing ThePureBag™.<br>
The germ-resistant way to carry your yoga gear in style.</h2>
<div class="margin">
<button class="contact">Contact Us</button>
</div>
</div>
</div>
</div>
</div>
<div id="grey">
</div>
</body>
Take the position:fixed off of the #container and take the position:absolute off of the .holder. This should make it work.
Position:fixed means that the element won't scroll.

CSS img overflow my div

I have 3 div with height : 100vh
But with the responsive my imgs overflow. You can check that on the image.
Sorry for my poor english !
This is the html :
<section id="services" class="container content-section text-center">
<div class="col-lg-8 col-lg-offset-2">
<div class="row">
<div class="col-lg-6">
<h2>Services </h2>
<ul>
<li>Covoiturages </li>
<li>Food </li>
<li>Hébergement </li>
</ul>
</div>
<div class="col-lg-6">
<img src="img/mockup-iphone.png" alt="mockup iphone" class="img-responsive"/>
</div>
</div>
</section> <!-- close about -->
<section id="communities" class="container content-section text-center">
<div class="row">
<div class="col-lg-6">
<img src="img/mockup-iphone.png" alt="mockup iphone" class="img-responsive"/>
</div>
<div class="col-lg-6">
<h2>Communities </h2>
<ul>
<li>Texte </li>
<li>Texte </li>
<li>Texte </li>
</ul>
</div>
</div>
</section>
And the css :
#services{
width: 100%;
height:100vh;
background-color: #62b030;
}
#services img{
height:90%;
}
Try to smaller the img to height: 80vh, or calc image max-height: calc(100vh-100px); overflow:hidden for #services might work, too. YOu can also add width, adn height to your img-responsive or your img class.

jumbotron height and float

im kind of new to css/html and bootstrap itself. I've encountered two problems.
One is: I want to fix the 3rd and 4th box height to 100%, but no mater what div, or class i change to 100% it makes no changes.
Second: How can i make Box4 go under box2, so its not inline with box3?
Link to describe problem: http://jsfiddle.net/BXZrX/6/
and here is a picture of what i want: http://oi62.tinypic.com/osqule.jpg
<div id="content">
<div class="jumbotron">
<div class="container-fluid">
<h1>Join now!</h1>
<p>To get full use of the website, register now!.</p>
Sign up
</div>
</div>
<div class="bordertop">
<div class="jumbotron">
<div class="container-fluid">
<h1>Box2</h1>
<p>text</p>
</div>
</div>
</div>
<div class="box3">
<div class="jumbotron">
<div class="container-fluid">
<h1>Box3</h1>
<p>text</p>
</div>
</div>
</div>
<div class="box4">
<div class="jumbotron">
<div class="container-fluid">
<h1>Box4</h1>
<p>text</p>
</div>
</div>
</div>
</div>
#content > div {
float:left;
width:49%;
}
#content > div.bordertop {
float:right;
width:49%;
}
#content > div.box3 {
clear:both;
width:49%;
float:left;
}
#content > div.box4 {
float:right;
width:49%;
}
Here's a start:
http://jsfiddle.net/jPZLd/11/
I've swapped boxes 2 and 3 so that they flow correctly down then across the page:
<div id="content">
<div class="column">
<div class="jumbotron">
<div class="container-fluid">
<h1>Join now!</h1>
<p>To get full use of the website, register now!.</p>
Sign up
</div>
</div>
<div class="bordertop">
<div class="jumbotron">
<div class="container-fluid">
<h1>Box2</h1>
<p>text</p>
</div>
</div>
</div>
</div>
<div class="column">
<div class="box3">
<div class="jumbotron">
<div class="container-fluid">
<h1>Box3</h1>
<p>text</p>
</div>
</div>
</div>
<div class="box4">
<div class="jumbotron">
<div class="container-fluid">
<h1>Box4</h1>
<p>text</p>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
Footer
</div>
If you need both boxes 2 and 4 to have the same baseline, it's easy if your content is static - just adjust the height of the shorter box manually, eg.
.box4 .jumbotron {
height: 319px;
}
It gets a bit harder if you have to deal with dynamic content. I think you'd end up needing to fake it by applying the background color to the container element and hiding the bits you don't want to see.

parent negative margin with nested floated divs wont follow the parent if object overlaps

Heh, sorry for the long title, but I need a fix for this and have been on it for some time now.
Basically there is a header and I'd like to move content underneath it.
Everything is relative (keeping it centered)
so header has a margin top, z-index, ecc.
The page is relative with a negative margin and contains nested floated columns that wont go up past the header (dammit) and cannot figure out why.
I would like to avoid using absolute positioning if possible.
Here's the code:
<div class="header wrapper-standard">
<div class="logo">
<div class="inside">hello</div>
</div>
<div class="menu-wrapper-outer">asda</div>
<div class="clear"></div>
</div>
<div class="about-page wrapper-standard notop">
<div class="about-page content">
<div class="about-block wrapper-long">
<div class="col col-left text-first">
asda
</div>
<div class="col col-right">
lol
</div>
<div class="clear"></div>
</div>
<div class="about-block wrapper-long">
<div class="col col-left text-first">
asda
</div>
<div class="col col-right">
lol
</div>
<div class="clear"></div>
</div>
<div class="about-block wrapper-long">
<div class="col col-left text-first">
asda
</div>
<div class="col col-right">
lol
</div>
<div class="clear"></div>
</div>
</div>
</div>
Here's the fiddle:
fiddle
Thanks.
Here is a very basic example of how you can have a fixed width, centered page with a fixed header which allows the content to flow underneath:
CSS:
<style type="text/css">
.wrapper{
height:600px;
margin:0 auto;
width:400px;
background-color:#0ff;
}
.header_wrapper {
position:fixed;
background-color:#ffd800;
}
.header {
width:400px;
background-color:#f00;
height:100px;
}
.page {
padding-top:100px; /*height of header*/
}
</style>
HTML:
<body>
<div class="wrapper">
<div class="header_wrapper">
<div class="header">Header</div>
</div>
<div class="page">
Content will be here bla bla etc
</div>
</div>
</body>
Here is a fiddle so that you can see it working: http://jsfiddle.net/JjBG5/1/