so I'm trying to tame the Footer so that it stays below the dynamic content container, but whatever way I try it (Pos: Abs, Bottom: 0; etc etc) it either appears halfway up the content or fixed at the bottom. Either I don't want. It would be appreciated if someone could shine a light on my problem.
HTML:
<div id="Content">
<div id="G6"></div>
<div id="Post-Block">
<div id="block">
<div id="feat-img"></div>
<div id="date"></div>
</div>
</div>
<div id="Footer">
<div id="G7"></div>
<div id="FooterBreak"></div>
<div id="FooterBG"></div>
<div id="FooterLinks">
</div>
<div id="Copyright">
</div>
<div id="Copyright2">
</div>
<div id="FooterBreak2"></div>
</div>
</div>
CSS:
#Footer {
width: 100%;
height: 230px;
position: absolute;
left: 0;
bottom: 0;
}
#Content {
z-index: 7;
background: url(/images/content%20bg.jpg) repeat left top;
position: absolute;
top: 336px;
width: 999px;
height: auto;
color: #fff;
min-height: 950px;
margin: 0 0 230px;
}
html {
position: relative;
height: auto !important;
}
body {
z-index: 0;
background: url(/images/background-texture%20d.jpg);
left: 0;
}
#page {
z-index: 1;
width: 1000px;
height: 1000px;
margin-left: auto;
margin-right: auto;
}
EDIT: When I used the Chrome dev tools to inspect the Crow's Perch website, it looks like your problem is that the height of your HTML is smaller than your content (ie, you use negative bottom values in your absolute positioning for some of your content). Given this, you could add bottom: -865 to #footer, but given that you said your content is dynamic, that's an EXTREMELY brittle solution. Unfortunately, since you're pixel-pushing all of your elements, I don't think there's a way to have your footer respond dynamically to your changing content. More comprehensive refactoring of your code is likely necessary.
Good luck!
Related
I need to create the illusion that an article's content is sliding underneath it's title when scrolling the page. The HTML looks like this:
<div class="wrapper">
<div class="header">
<h1>Title</h1>
</div>
<div class="body">
<p>a lot of content</p>
</div>
</div>
CSS looks like this at this point:
.wrapper{
height: 100vh;
width: 50%;
margin-left: 25%;
margin-top: 100px;
position: relative;
}
.header{
padding: 20px;
background-color: #fff;
position: fixed;
display: block;
box-sizing: border-box;
width: calc(50% - 8px);
z-index: 2;
}
.body{
z-index: 1;
top: 120px;
position: absolute;
padding: 20px;
background-color: #fff;
}
https://jsfiddle.net/joris508/frad472j/
Because there's an image in the background of the real website, I can't just put an element with a higher z-index to the top to hide that part.
I also tried to make the content portion (.body) scrollable itself. That created the right effect visually, but because the background-image on the page has a parallax scroll effect, scrolling the div itself caused problems.
Is there any solution to this problem?
Here is my test site http://mint.sbdigi.com/, notice the carousel that it has a white space in between when transitioning. I am not sure why that is happening. Any help please.
Here is a short code that I have:
HTML
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item text-medium active" style="height: 100%;">
<h2>Your Fresh New Family Dentist</h2>
<div class="carousel-overlay"></div><!-- carousel-overlay -->
<div style="background-image:url('http://mint.dev/wp-content/uploads/2015/06/Mint_Dental_sliderimg_02.jpg');" class="fill"></div>
</div>
<div class="item text-medium" style="height: 100%;">
<h2>Bright Smile Package</h2>
<div class="carousel-overlay"></div><!-- carousel-overlay -->
<div style="background-image:url('http://mint.dev/wp-content/uploads/2015/06/Mint_Dental_sliderimg_03.jpg');" class="fill"></div>
</div>
<div class="item text-medium" style="height: 100%;">
<h2>Refresh Package</h2>
<div class="carousel-overlay"></div><!-- carousel-overlay -->
<div style="background-image:url('http://mint.dev/wp-content/uploads/2015/06/Mint_Dental_sliderimg_04.jpg');" class="fill"></div>
</div>
<div class="item text-medium" style="height: 100%;">
<h2>New Patient Combo</h2>
<div class="carousel-overlay"></div><!-- carousel-overlay -->
<div style="background-image:url('http://mint.dev/wp-content/uploads/2015/06/Mint_Dental_sliderimg_05.jpg');" class="fill"></div>
</div>
</div></header>
CSS
header.carousel {
height: 550px;
}
#mint-landingcarousel .carousel-indicators {
z-index: 2;
}
.carousel-indicators {
bottom: 20px;
}
.carousel-inner {
overflow: hidden;
position: relative;
width: 100%;
}
header.carousel {
height: 550px;
}
header.carousel .item {
height: 100%;
}
header.carousel .item.active {
height: 100%;
}
header.carousel .item h2 {
font-size: 90px;
left: 25%;
position: absolute;
text-align: center;
top: 35%;
width: 50%;
z-index: 9999999;
}
header.carousel .carousel-inner {
height: 100%;
}
header.carousel .fill {
background-position: center center;
background-size: cover;
height: 100%;
position: relative;
width: 100%;
z-index: -9999;
}
.carousel-overlay {
background: rgba(0, 0, 0, 0.2) none repeat scroll 0 0;
height: 100%;
position: absolute;
width: 100%;
z-index: 9999;
}
I am not sure if this code is enough. let me know though if you still want of my code. Some of these codes are default in the twitter bootstrap css.
At a first look it seems that:
an .active class is being added on the active image in your carousel.
.active class defines the height for a visible/active item in your carousel.
When .active is not present height is not set so image is not visible.
You should change the behavior of your script, keeping height for visibility of you hidden images otherwise you get the white color your page background.
I hope it helps.
I think you have custom CSS .left{float:left;} and .right{float:right;}
When the carousel slides it adds classes of left and right to the containing div. Remove the left and right floats in CSS.
OR
Add a inline property
<div class="item text-medium" style="height: 100%; float:none;">
It seems there is a "left" class being added to the "active" class through every iteration. I'm not sure if that is the solution but you could research that a bit.
Being that you are only using three images, if you want you could set the background of those images to the same exact image so that through each iteration (when they disappear), there is the same image still in the background. This is not efficient nor is it good for page speed/load, however, but it is a solution nonetheless.
JSFIDDLE demo
HTML
<div class="ratio-1439-330 bg-cover" style="background-image: url('https://www.agtinternational.com/wp-content/uploads/2013/11/City-solution.jpg');">
<div class="l-center" style="max-width: 1240px;">
<div class="square-logo bg-cover"
style="background-image:url('http://www.astronautamarcospontes4077.com.br/wp-content/uploads/2014/07/person-icon.png');">
</div>
<div class="header-cover" style="background-color: #373737; opacity: 0.9; position: absolute; bottom: 0; left:0; width: 100%; overflow: hidden; padding: 10px 0;">
<div class="l-center" style="max-width: 1240px">
<div class="nav nav-tabs" style="margin-left: 338px">
<a class="active" href="#overview" data-toggle="tab">
Overview
</a>
<a href="#visits" data-toggle="tab">
Visit
</a>
</div><!-- ./tab-lined-top-->
</div><!--tabs-->
</div><!--header cover-->
</div>
</div>
<div class="tab-content l-center" style="max-width: 1240px;">
<div id="overview" class="tab-pane active">
<div class="l-center" style="max-width: 1240px;background:red;">
TEST 1
</div>
</div><!--#overview-->
<div id="visits" class="tab-pane">
<div>
TeST 2
</div>
</div>
</div><!--tab-content-->
CSS
[class*="ratio"] {
position: relative; }
[class*="ratio"]:after {
content: '';
display: block; }
[class*="ratio"] .cly-ratio-content {
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0; }
.ratio-1439-330:after {
padding-top: 22.932592078%; }
.l-center{
margin: 0 auto;
}
.square-logo{
background: #fff;
position: absolute;
width: 180px;
height: 180px;
bottom: 25px;
left: 0;
margin-left: 115px;
z-index: 800;
opacity: 1;
}
.bg-cover{
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
}
.nav-tabs{
border-bottom: 0;
}
.nav{
margin-bottom: 0;
}
Currently it works on jsfiddle, but not on my local machine so you might not understand what I am asking.
Bootstrap is only there for tabs to be clickable. The logo move from left to right when browser is being resized and it looks jumpy while moving. Another issue is that the div with l-center and max-width seems not to be working well for tab pane content. Suspect that it is because of no height.
Is there any way around to force make logo stay vertically lined to tab content and tabs should move as well while browser is resizing?
Help appreciated!
If I understand you correctly, the problem must be that the block of code below has a fixed margin left property value of 115px. So it doesn't actually move on re-size, it just leans on the given margin value. Until there isn't a fixed margin-left, it will keep happening.
.square-logo {
background: #fff;
position: absolute;
width: 180px;
height: 180px;
bottom: 25px;
left: 0;
margin-left: 115px;
z-index: 800;
opacity: 1;
}
Fix I suggest you do something like below
.square-logo{
background: #fff;
position: absolute;
width: 50%; /* Adjust as needed */
height: auto;
bottom: 25px;
left: 25%; /* Adjust as needed */
z-index: 800;
opacity: 1;
}
Note: You may need to adjust the example to suit your need. Just don't use margin-left
First of all please remove the inline css for flexibility. If your html code like this
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="square-logo">
<img src="images/logo.png" alt="Logo">
</div> <!-- End Logo Block -->
</div> <!-- End Column 12 -->
</div> <!-- End row -->
</div> <!-- End Container -->
Then to make your logo center add this css code.
.square-logo {
display: table;
margin: 0 auto;
}
I feel like this should be an easy answer but cant figure out how to achieve this effect.
Essentially i'm trying to do this: http://demo.smooththemes.com/theone/
one this site, when you start scrolling the image stays fixed and the content scrolls over top. Any ideas?
Thanks for you help.
example
http://jsfiddle.net/gvMLS/
HTML
<div id="header">
</div>
<div id="content">
content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>
</div>
CSS
#header {
position: fixed;
top: 0;
height: 20px;
width: 100%;
background-color: #ff0000;
}
#content {
position: absolute;
top: 20px;
bottom: 20px;
width: 100%;
background-color:#fff;
overflow: auto;
}
I'm having some trouble figuring out how to do this. I want to have a wrapper so my site is centered, but one of the header elements needs to stretch all the way to the right edge of the page, but without expanding the width of the page and adding scrollbars.
See here: http://i49.tinypic.com/6rkaxc.jpg (new poster so can't add image)
The blue outline represents the centered wrapper, and the orange box is the header div that I'm trying to get to fit to the right side of the page. I've got it to work using 100% width but it creates a horizontal page scroll since it's making it the same width as it's parent. I want it to expand for users that have higher resolutions so it always fits snug to the right side. I hope this makes sense.
my code looks something like...
<body>
<div id="wrapper">
<div id="header">
</div>
<div id="left">
</div>
<div id="right">
</div>
</div>
</body>
CSS:
div#wrapper {
margin: 0 auto;
width: 1020px;
position: relative;
}
div#header {
height: 150px;
position: absolute;
left: 510px;
width: 100%;
}
div#left {
width: 510px;
float: left;
}
div#right {
width: 100%;
float: left;
}
I'm pretty new to this stuff so if you notice any errors here or bad practices please point them out! Thanks for the help! :)
Since you want your content to be fixed width, a strategy would be to have containers for both left and right contents. This allows you to use width: 100% for the header which will extend to the end without scroll bars. You then make the header relative to the right container. Here is a jsfiddle you can play with.
Note I made the widths smaller so it would fit in my jsfiddle window.
HTML:
<body>
<div id="wrapper">
<div id="leftContainer">
<div id="left">
This is left
</div>
</div>
<div id="rightContainer">
<div id="header">
This is a header
</div>
<div id="right">
This is right
</div>
</div>
</div>
</body>
CSS:
div#wrapper {
text-align: center;
width: 100%;
position: relative;
white-space: nowrap;
overflow-x: scroll;
}
div#header {
z-index: 1000;
height: 150px;
position: absolute;
left: 0;
width: 100%;
background: green;
}
div#leftContainer {
float: left;
width: 50%;
height: 500px;
display: inline-block;
}
div#left {
float: right;
width: 260px;
height: 300px;
background-color: purple;
}
div#rightContainer {
position: relative;
float: right;
width: 50%;
height: 500px;
display: inline-block;
}
div#right {
width: 260px;
height: 300px;
background-color: yellow;
}
Try this one. I changed the wrapper width to 80%. Not sure if that's ok. But I works well when expanding the page. Moved the header outside of wrapper and also added background color for clarity.
Note 1: right DIV's margin-top is same size as header DIV's height.
HTML
<div id="outerWrapper">
<div id="header">
Header
</div>
<div id="wrapper">
<div id="left">
Left
</div>
<div id="right">
Right
</div>
</div>
</div>
CSS
div#wrapper {
margin: 0 auto;
width: 80%;
height: 100%;
position: relative;
background-color: #CCCCCC;
}
div#header {
height: 150px;
float: right;
position: absolute;
left: 50%;
width: 50%;
background-color: yellow;
}
div#left {
width: 50%;
height: 100%;
float: left;
background-color: red;
}
div#right {
width: 50%;
height: 100%;
float: left;
margin-top: 150px;
background-color: blue;
}
Hope this helps.