I've got a PSD template to convert it to HTML. How do I deal with the background food images (highlighted red on the image) when I zoom-out the browser? The total width is 1300px, container is 1000px. What would be the best approach? Do I repeat them? How? What would you do? Thank you.
Please try this:
html {
background: url(images/yourimage.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Basically you can go through 2 approaches to get that done...
Use 3 different div's to work out.
<div class="left-div"><img src="food_img1.ong"/></div>
<div class="inner-div">Here goes main container</div>
<div class="right-div"><img src="food_img2.ong"/></div>
Try to use the method given by user Satya above as,
html,body{
background:#333333 url(../img/bg/bg3.jpg) no-repeat center center;
background-size: cover;
}
Related
Was curious how you make image text kind of like this
https://dribbble.com/shots/2150115-Alltracks/attachments/393908
There are several ways to approach this. You could set a background image across the page in CSS3, for example, which would look 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 may also want to see Clipping and Masking in CSS. (left in comments by nzkks)
My webpage is currently set up as following:
Documents/Portfolio/Index.html
Documents/Portfolio/CSS/Main.css
Documents/Portfolio/Assets/images/mountains.jpg
In my CSS:
background-image: url('../Assets/images/mountains.jpg') no-repeat center center fixed;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
color: #fff;
Sorry for the noob question, but I can't figure this one out. I tried several things and moving the photo around and still no luck.
You are providing too much data to the background-image property, replace it with the background property.
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 wanted to do this in CSS but javascript is ok too.
I have a png image I use as the menu bar that I put over my background image. Theres a part of the image that exceeds the page to the right. I want it to just be cut out of the screen instead of strectching the web page and making a white line appear to the right of my background image.
Just in case the CSS:
position:absolute;
left:2%;
width:120%;
top:-220px;
height:700px;
z-index:6;
Any help is appreciated! Thank you!
May be set the width to 100% or less!
how about background-size: cover;
#abc {
background: url(http://i.imgur.com/nvH8nI3.jpg) 50% 0 repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
I have used twitter bootstrap to make a webpage.
I have inserted an image in background through CSS as following.
<div class="container-fluid">
<div class="row-fluid">
<section id="wrapper">
</section>
</div>
</div>
CSS is as follows:
section#wrapper{
max-width:700px;
background-image:url("img/crane.png");
min-height:525px;
}
When I resize browser size the image is not getting resized according to screen size.
I am not getting how to make it responsive.
So please can any one help me out to resolve this issue.
Thanks in advance.
Try this
section#wrapper{
background:url("img/crane.png") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
You can use CSS3 background-size with cover as a value and not 100% property for a full page responsive background image for your website
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;
}
For more info
You should use the background-size property and set it to cover like in the following shorthand:
div.withBackground {
background: url('http://image.url/img.png') center center cover;
}
read more here
try this background-size:100%;
but not all browser works lower version of browser not recognize background-size