I’m making a chrome extension and I have a div element that I want to keep the same size and position no matter what. When a user goes to a web page and clicks (Ctr+Shift+(+ or -)) I want the element to keep its same size and position. Is this possible with javascript, CSS, and HTML. Thanks!
2
Answers
I think what you are looking for can be achieved by viewport units. Example:
viewport units.
Example:
The problem is that we cannot see your code or part of it so we can only guess what you really need. But if I guess right then the following code will help you achieve what you want
Set width using VW and height using VH, that will help you make the width and height be always the same no matter what.
1 VH or VW means 1% of the device screen width or height. So if you set the following values:
I hope this help you in what you need. You can always ask me something here