Resize image with CSS

Asked

Viewed 367 times

-1

I have a question about CSS image resizing.

I have an image 1920x1080.

This image should be automatically resized to fit any screen, but I’m not able to do this.

Check out this site: http://www.dadaabstories.org/

At the top begins to play a video, this is how I want my page to stay, but in place of the video, an image.

2 answers

1

Use the background-size: cover property to resize the background image. For example:

body{
   background-image: url('beach.jpg');
   background-size: cover;
}
  • The problem is it’s not a background image.

0

Try to apply:

background: url(sua-imagem.jpg) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.