I know there are several other questions about the sticky footer, but none have seemed to help me get to a solution for my problem. Here is the template in question:
http://blog.campquiet.com/stack/
Basically I would like the background with the transparent side bars to extend to the bottom of the browser window. The footer (copyright info) should always be at the bottom of the screen as well, even if there isn't enough content to push it that far).
Any suggestions??
Update
Maybe I wasn't as clear as I needed to be. Basically I'm trying to accomplish what is seen here: hxxp://www.cssstickyfooter.com/
I haven't been able to get that working in my template.
You need to set the body and outer container to 100% height. This answer may help you: CSS 100% height with padding/margin
I'm not really sure I understand what you're asking, but to keep the footer always at the bottom, perhaps try something like this
#footer{
position: fixed;
bottom: 0; /* Keeps the footer glued to the bottom of the page */
z-index: 9999; /* Keeps the footer on top of all other elements */
}
For the background, try to apply the CSS to the body tag?
body{
background: url(assets/images/bg_clouds.jpg) fixed 0 0;
}
You can apply extra settings for the background (like position & repeat) to get it to look like it is currently. Anyway, if this doesn't answer your question, please help me out with a more detailed explanation of your question.
Hope that helps.
UPDATE
I played around with Firebug to edit your CSS. I think if you get rid of the background css under html, body {} and add this to your body {}
body {
background: url("assets/images/bg_clouds.jpg") repeat-x fixed 0 0 #F0F4F7;
}
... it will keep the background static even if you scroll. It will always be there. Make sure you have fixed instead of scroll
Related
I am trying to write clean code without wrappers.
So let me give an example
<head>
</head>
<body>
<header>Header and nav section (Leaving nav in header is good way?)</header>
<article>Main content. This part should stretch</article>
<aside>Not so important but desktop view still have place for it</aside>
<footer>Just footer but sticky</footer>
</body>
The first try was to give footer a
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 100px;
and for body
margin: 0 0 100px;
after this just set min-height: 100%; to html and it works fine.
Now I'm trying to pin aside just at the top of the footer and I can't because I need to stretch the article to cover the rest of the page.
And finally the question:
How can you achieve this if the size of the aside changes depending on the subsite, and I don't want to use wrappers because they are kind of ugly?
Additionally is it possible to use html5/css3 magic (I found advice to use flex but without example...) and still have compatibility with ie8. Usage of XP is still huge in my country sadly.
I spent a couple of days on SO and I found many examples using wrap for the whole page that includes footer or wrap for header and content that leaves footer as another box, but that's not what I want.
Update
I partially found the solution.
Link to snippet
But now I have another strange problem.
Here is example my page
I have an empty space below the footer and according to dev tool in chrome and IE this part belongs nowhere.
How is this possible?
1.footer should be position fixed
2.for body: dont use margin, use position:fixed; bottom:100px;
3.min-height:100%. Well, this is kinda nonsense. Simply use height:100%;
I'm new to stackoverflow and so I apologize in advance for rehashing any issues already addressed here (I'm sure they are, just not sure how the apply to my specific situation).
Anyway here is the site I'm working on - www.betsyandalex2013.com. I would like to have all of the elements fixed in place. I've been playing around with it using Firebug but when I use position: fixed; on say #wrap I can't scroll over to see the rest of the content. Alternately, when I fix the position of #header, the links disappear. Again, I would ideally like to fix all the elements in place and be able to scroll across (and up/down) to see any content when the browser is resized.
I am not sure what you said. But setting:
#header {
position: fixed;
top: 0;
}
It will work: The header will be out of the natural flux of your page and it will be at top of the screen even when you scroll down/up.
PS: To see the effect put content to #wrap element.
I want my footer to always be stick to the bottom of the screen, except in the case when there is enough page content to fill the screen In this case, the content should take priority and push the footer off the bottom (so that you have to scroll to see it).
Here is an example of desired behavior:
http://ryanfait.com/sticky-footer/
To be clear, I know about fixed toolbars in JQM, they are not what I want because they take up valuable screen space when there is a lot of content.
The closest I have come is the following CSS rule:
[data-role=footer] {
bottom: 0;
position: absolute;
width: 100%;
}
If you know a better way, please post an answer!
May be you should try Fixed Full screen or non-full screen but fixed Header and footer in JqMobile...
In jqMobile, this feature is added and is the most vibrant feature in it for webapp developers..
Take a look at it..
Fixed toolbars : JqMobile
Also you can apply custom css for the space issue by adding classes...
My best solution:
$(document).ready(function(){
$("html, body, .ui-page").height($(window).height());
}
Hope this helps.
First, a warning, I have come back from a years break of html/css and have pretty much forgotten everything, so I'm at newbie level again.
I have been trying to add background images - one at top left and one at bottom right. What I have at the moment can be seen here: http://test.nihongohub.com/Mainsite/firstsite.php as you can see if you change the width of the browser the div containing the img will hit my main part and ruin it.
I have tried a few fixes suggested on stack overflow but none of them worked. Does anybody have any suggestions how to fix this. A friend suggested that I add the img to the footer and squeeze it out, but I don't like this idea.
2 things I want this image to do, move with the browser window, and be able to go behind my main page.
Thanks for any help offered
You could try using fixed positioning and the use z-index to move it to the back, ie.
#bottom_leaf_holder {
position: fixed;
bottom: 50px;
right: 0;
z-index: -1;
}
edit: I ment fixed, changed the answer.
You could put all your content in a div, and add a css rule to that div. Something like
#main_holder {
background: transparent url('img.jpg') no-repeat bottom right;
}
The best solution for this would be to have a wrapper div just inside the body tag that contains only the background image. This will act similar to the body tag allowing you to place an image that does not interfere with the layout and will go underneath your content if the viewport is small.
I know this has been asked here countless amount of times, I've looked around trying to implement the given solutions.
#footer
{
min-width: 900px;
text-align: center;
position: absolute;
}
Its the very last div on the page. I'm testing it out here blog.0arrays.com (a default theme for tumblr), but the footer just won't stick to the bottom. It appears in the middle of the page. I can provide the full code if anyone wants to look at it, as it's too long to paste here.
Thanks in advance.
EDIT:
I don't really care if its sticky or not (i.e right at the bottom), I just don't want it to appear in the middle of my text, as you can see on the site.
EDIT 2:
I've posted the full code here (via pastie), arrrr.... I bet the answer is really simple, this is doing my head in. For some reason, your suggestions are not working.
No one...?
In addition to the other attributes you've set for #footer, you should also add bottom:0 to set it's position to be the bottom of the page.
EDIT: You will also need position:fixed instead of absolute
If you don't care about keeping the footer at the bottom you just have to remove position: absolute; from #posts.
If you want to make the footer stick to the bottom of page, use fixed position.
#footer {
position: fixed;
bottom: 0px;
}
I just need to use
`display: table-row;'