Background-size (Mozilla Firefox)

Asked

Viewed 93 times

1

I have the following code

background-image: url(#minha0imagem#); 
background-size: contain; 
background-repeat: no-repeat;

Chrome is the way I want it, in the center and full screen. Firefox is not.

I’ve tried -Moz, -Webkit, I’ve already updated my firefox.

It seems that the way firefox works with image resizing is different from Chrome and even using pure CSS3 and HTML5 I can’t replicate the effects.

  • what behavior you’re hoping the contain has been?

  • Maybe it’s another property or another HTML element that’s making it wrong in FF. Take this example of W3SCHOOLS, see if in both browsers it looks the same: http://www.w3schools.com/cssref/playit.asp?filename=playcss_background-size&preval=contain

  • Have you tried removing the superfix -image and specifying positions and sizes in the same style property? Maybe the version of this Firefox recognizes so... Unfortunately I can’t exemple now because my notebook ñ is calling and I’m no longer familiar with CSS(3. It gets... complicated.

  • @Rafaelacioly the behavior of the contain is by characteristic of my image, I know that to have screen all should be used the cover rs!

  • @Guilhermebrancostracini both browsers appear equal in the link you sent.

  • @Theprohands tried yes! Even tried to put everything only with background using the property features.

  • @Israelbastos tested on firefox and firefox Veloper and its code worked perfectly.

  • Thanks a lot, but as I could not I ended up opting for another solution, I used a div, an img tag with width and height and modified by css the details taking the lateral and horizontal scroll (a gambiarra rs) but at least the result was expected.

  • So there really is something else causing the divergence in the FF

Show 4 more comments

1 answer

0

Try this:

background: url('sua_imagem.jpg')no-repeat center top;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
  • I tried and nothing buddy! But thanks for the strength, I managed otherwise, with a "almost" gambiarra rs

Browser other questions tagged

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