On this website there's a background image in the footer that should stick to the bottom of the page. I don't mean the visible part of the page, but rather the very bottom of the page. However on pages where the content is short - like this one - it appears some distance above the bottom.
The CSS that I'm currently using is:
html {
background: url(../images/responsive/bg.svg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
outline:0!important;
}
What you're asking to do is more in-line with the concept of a "sticky footer". Example and tutorial
What about using the float attribute:
float: bottom;
Related
I have the problem that on my website, when I scroll fast on mobile, the background image moves up a bit and a white space at the bottom appears, and then disappears again when I stop scrolling.
I've tried a bunch of solutions to similar problems to prevent this from happening, but I haven't been able to solve it so far.
Here's the my css for the background image:
html {
background: url(bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
And a screenshot of the issue:
Try adding the background img to the body aswell like this:
html, body {
background: url(bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Try this code for mobile to the background image show all sides clear images but if your image is big then the image is stretched so first, you need to create a div container to fit your image into the div container.
html, body {
background: url(bg.jpg) no-repeat center center fixed;
background-size: 100% 100%;
}
I'm creating a form on my page with bootstrap css.
I use an image as background which covers the entire background.
bootstrap seems to add a semi-tranparency to the top of my page, which disappears when scrolling the page: http://www.landoflove.be/medewerkers.php and I can't seem to find out why it's doing that. It does the same thing on the main page landoflove.be .Why is this happening and how can I disable it?
Your html code is invalid. There's no doctype and you have unclosed div somewhere. Fix this first, then add:
html, body {padding:0; margin:0}
Check this CSS in your landoflove.css file
body, html {
height: 100%;
background: url(../img/bgoff-min.png) no-repeat center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
font-family: baloo paaji, sans-serif;
}
The problem is here
background: url(../img/bgoff-min.png) no-repeat center fixed;
Your image is having the size of 1227 X 1159 pixels. and you have added no-repeat center fixed
if you remove that you will have the background to be stretched something like this
Also, you need to modify the HTML
Seems that you are using only one
<div class="row"></div>
and all your form elements are inside this which is not a right approach.So suggesting you to have one form-group in one row
the mark-up was indeed invalid for some tags because is was a work in progress.
I seem to have found what my particular problem was:
body, html {
height: 100%;
background: url(../img/bgoff-min.png) no-repeat center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
font-family: baloo paaji, sans-serif;
}
The height: 100% caused the problem. Now the transparent layer is indeed gone, but i still have no clue why it added such tranparency in the first place.
I'm building a website, and I just have to make a welcoming page.
It's a simple page: just a background with a button, which directs to our homepage. I just have one problem with the background: my background is too big.
How can I edit with CSS and HTML so that my wallpaper fits all the screens?
(I want to make the page unscrollable.) All I have so far in the CSS:
body{
background-image:url("voorpagina.jpg")
}
Thanks a lot!
P.S. I've already tried background-size:cover; but it didn't seem to work?
body{
background: url("voorpagina.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
this should work if not you could use media-quires,
similar to your question 1
similar to your question 2
I'm working on a basic html page and I have this background image bg.jpg.
But the problem is depending on the screen size you have and how many pixels the screen has I'm not able to view the whole background image which is something I want.
How do I make the background fixed so you can see the whole background?
If you mean a full page background image than you can simply do it with CSS3 background-size property
body {
background: url(bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
If you need to attach it, kinda fixed and shouldn't be scrolled, than use
background-attachment: fixed;
/* This is already used in above CSS declaration using CSS Short Hand*/
You can do something like this:
html {
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
You can read more here: link
Delete your "body background image code" then paste this code:
html
{
background: url(../img/bg.jpg) no-repeat center center fixed #000;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
You can use CSS pseudo selectors.
body:after
{
content: url(your_image)
/* Styling your image here just like a div */
}
Of course those other solutions are OK too, but they only work in latest modern browsers. This pseudo selection solution works in most browsers used today. If you'd like to support even older browsers, like ancient versions of IE, then you can use a div to contain the background image and style it as you'd like.
I recently found the problem on a recent question I asked here which was related to what I thought was a Chrome or Safari webkit bug, or maybe something inside my style.css. However, I noticed after a while that my background was slightly moving on resize, and I concluded that when it moved towards the right, a left white border didn't show up from top to bottom on the left side of the screen, but when the background picture moved towards the right hand side then a 2px white border showed up on the left right side. How do I stop the border from moving.
MY CSS:
html {
background: url(/assets/fotball.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Try this:
background: url(/assets/fotball.jpg) no-repeat center top fixed;
Change your code to this: jsFiddle Live Demo
html {
background: url(/assets/fotball.jpg) repeat center top fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-position:;
}
When you use background-size: cover;, it makes no difference to use background:no-repeat or background:repeat. So in this case you can use repeat to solve your problem.