I am currently working on developing an HTML5, CSS3, and JavaScript based game. I really want everything in the game to be resizable, including text, fonts, and images, adjusting according to the width and height of the screen. For text and font, I have discovered that using 'em' instead of 'px' allows for relative scaling based on the body font size. Now my question is, how can I achieve this same scalability for images and other elements?
<div id="titlediv" style="text-align: center; position: relative; height: 20%;
width: 90%; margin: 0px auto; padding: 40px 0px 40px 5px; margin-top: 0%;">
<p style="font-family: 'Arial'; font-size: 400%;">
Quiz Game
</p>
<br />
<p style="font-family: 'Arial Rounded MT Bold'; font-size: 150%;">
The definitive place for games
</p>
</div>
So far, this code snippet pertains to the game title, with the remaining code following a similar format.