How can I make the div background image scale to the page size?


Silent casein 114

I'm trying to make the background image of the div header scale to the size of the page. Here is the current CSS:

.Header {
    background-image: url(Images/logo.png);
    height: 160px;
    width: 960px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 20px;
}
nifCody

Set the position to the absolute position of the header and set the width to 100%

position:absolute;
width:100%;

Related


How can I make a div clickable over the entire background image?

Vignesh Pichamani I added a background image to the parent divdiv width and 100%I redirect when you click on the div (everything works), but I only want to redirect the div when you click from left to right. 100px;For example, here is a fiddle I call a div wit

How can I make a div clickable over the entire background image?

Vignesh Pichamani I added a background image to the parent divdiv width and 100%I redirect when you click on the div (everything works), but I only want to redirect the div when you click from left to right. 100px;For example, here is a fiddle I call a div wit

How can I make a div clickable over the entire background image?

Vignesh Pichamani I added a background image to the parent divdiv width and 100%I redirect when you click on the div (everything works), but I only want to redirect the div when you click from left to right. 100px;For example, here is a fiddle I call a div wit

How can I make the image take the full size of the DIV?

Paula I've created a custom "product card" for my website, and I want the images to take the full width and height of the parent regardless of the dimensions of the images. I've tried it max-width min-width max-height min-height, but none seem to work. I can't

How can I make the image take the full size of the DIV?

Paula I've created a custom "product card" for my website, and I want the images to take the full width and height of the parent regardless of the dimensions of the images. I've tried it max-width min-width max-height min-height, but none seem to work. I can't

How to scale background image on div with background dimensions

Y Onyx I want to make the div element stretch to 33% width and finish the background image in CSS background-image:url(); background-size:cover How to animate a background image in a div on mouseover or mouseneter, is there a plugin that can do this? The bac

How can I make the background image not stretchable?

Billy Logan In my project I set a background image with the following properties: body { background-image: url("/"); background-size: cover; background-repeat: no-repeat; } However, when there are many elements on a page, this image is stretched and enl

How can I make this background without the image?

shroud Is it possible to make a background gradient like this in the picture. I found that this can be done with a radial gradient, but for some reason my gradient is a circle. Maybe it's better to use an image? How can I make clear border like the picture. .b

How can I make the background image fade in?

blue star <html> <head> <script type="text/javascript" > function changeImg(imgNumber) { var myImages = ["1.jpg", "2.jpg", "3.jpg"]; var imgShown = document.body.style.backgroundImage; var newImgNumber =Math.floor(Math.random()*myImages.length); document.body

How can I make the background image fade in?

blue star <html> <head> <script type="text/javascript" > function changeImg(imgNumber) { var myImages = ["1.jpg", "2.jpg", "3.jpg"]; var imgShown = document.body.style.backgroundImage; var newImgNumber =Math.floor(Math.random()*myImages.length); document.body

How can I scale the background image of my phone using CSS?

Chris I'm trying to scale a background image on a mobile device so that the height is rescaled to 100% of the device height, and the width is cropped as needed to maintain the aspect ratio. I am currently using the following code to center and fix the image: b

How can I scale the background image of my phone using CSS?

Chris I'm trying to scale a background image on a mobile device so that the height is rescaled to 100% of the device height, and the width is cropped as needed to maintain the aspect ratio. I am currently using the following code to center and fix the image: b

How can I center (background) an image in a div?

uncle Is it possible to center the background image inside a div? I've tried almost everything - without success: <div id="doit"> Lorem Ipsum ... </div> //CSS #doit { background-image: url(images/pic.png); background-repeat: none; text-align: center; } is

How can I center (background) an image in a div?

uncle Is it possible to center the background image inside a div? I've tried almost everything - without success: <div id="doit"> Lorem Ipsum ... </div> //CSS #doit { background-image: url(images/pic.png); background-repeat: none; text-align: center; } is

How can I center (background) an image in a div?

uncle Is it possible to center the background image inside a div? I've tried almost everything - without success: <div id="doit"> Lorem Ipsum ... </div> //CSS #doit { background-image: url(images/pic.png); background-repeat: none; text-align: center; } is