Is there any way to keep every single thing in my code in the exact same position? For example, my text is positioned with padding and a percentage value and when I change the viewport size, the text moves (probably to fit the padding) Is there any way to change this and keep my text in a fixed position at any viewport size?
2
Answers
Yes, there are ways to keep elements in your code in the exact same position regardless of the viewport size, like with position Absolute, Fixed Positioning, Use Fixed Units, Media Queries.
Let me give you an example:
Here is the html:
Here is the css:
By using absolute positioning with fixed pixel values, the text will stay at the specified position regardless of the viewport size or device used.
The fixed div will always be the same size, just use the min property.