Is there any way in HTML to prevent the user of a site from using the browser zoom?

Asked

Viewed 1,220 times

0

In the html audio tag can I set the player size? In Explorer gets very big!

My problem is this: I would like the use of zoom in and zoom out of the browsers not surtisse effect on a particular page where there is only the login to do. I put a background image, but if you zoom in or zoom out the form, which has a transparent background, goes to another part of the image. I wanted to keep always in the same place. The background is set to fit any screen size.

I wonder if that’s possible.

  • 1

    Please describe your problem better and put HTML.

  • I added to the text question of your comment, but I still think it’s unclear for us to be able to help.

  • 8

    I’m sorry, but I think you’re thinking wrong. You cannot limit the user to not being able to zoom in, just because its layout gets ugly or wrong, you must optimize/fix the layout so that it works well at any zoom, because if it is a physical need of the user to use enough zoom to be able to read? how does it look?

  • I fully agree with @Jader

  • 1

    I don’t ignore these facts, but the picture is really great.

1 answer

2

Although I agree with colleagues in the comments, something that might help is to put css in the property background-attachment.

body { 
    background-image: url('endereco-da-imagem.gif');
    background-repeat: no-repeat;
    background-attachment: fixed;
}

This property can be Fixed, scroll or local.

You can also make a repeat background, a pattern, by separating this image from the rest of the sprites.

As for audio player you can determine the width and height in embed:

<audio controls>
  <source src="horse.mp3" type="audio/mpeg">
  <source src="horse.ogg" type="audio/ogg">
  <embed height="50" width="100" src="horse.mp3">
</audio>

Again: the colleagues are correct. You should not take away from the user the control he has of his own browser, but make your experience enjoyable on any device.

Browser other questions tagged

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