Responsive div with fixed aspect ratio dynamic child div

Responsive div with fixed aspect ratio dynamic child div

<a href="https://jsfiddle.net/0d5gq6yw/" target="_blank">Here</a>&nbsp;is a JSFiddle. I applied the&nbsp;<a href="https://www.w3schools.com/howto/howto_css_aspect_ratio.asp" target="_blank">padding trick</a>&nbsp;which works for horizontal resize. However, it doesn't work for vertical resize. In other words, I want the height of the yellow div to be a fixed percentage, say 15% of the container. But the aspect ratio of the yellow should stay fixed. So if I resize (downsize for instance) vertically, my goal is for the width of the yellow div to decrease as well as the height in order to: 1) maintain the aspect ratio. 2) maintain the percentage width&nbsp;<strong>and</strong>&nbsp;height of the yellow div. Is this possible without JavaScript? I'm fine with any CSS3 if available.

Here is a JSFiddle. I applied the padding trick which works for horizontal resize. However, it doesn't work for vertical resize. In other words, I want the height of the yellow div to be a fixed percentage, say 15% of the container. But the aspect ratio of the yellow should stay fixed. So if I resize (downsize for instance) vertically, my goal is for the width of the yellow div to decrease as well as the height in order to: 1) maintain the aspect ratio. 2) maintain the percentage width and height of the yellow div. Is this possible without JavaScript? I'm fine with any CSS3 if available.

Below is the code as well:

html, body {
  height: 100%; 
} 
.container {
 position: relative;
  left: 10%;
  width: 80%;
  height: 80%;
  top: 10%;
  background-color: maroon;
}
.content {
  background-color: yellow;
    width: 20%;
    padding-top: 10%;
    bottom: 0;
    position: absolute;
    left: 40%;
    /* height: 15%; of course this doesn't work */
} 
<div class="container">
  <div class="content"> 

</div> </div>


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

HTML 5 Tutorial: How to create a table using HTML tags and Stylesheet (CSS)

In this article, we want to show you how to create a table using HTML tags and Stylesheet (CSS). HTML table may vary depends on data and style requirements. Sometimes, in the real application, we use an HTML table as a layout of the Email template in HTML format.

Introduction To HTML & CSS: Web Development For Beginners

Introduction To HTML & CSS: Web Development For Beginners - Complete HTML & CSS web developer bootcamp. Learn & practice website design using HTML5 & CSS3 web development resources

How to performance Improve of HTML and CSS

There are a variety of ways you can improve your HTML and CSS performance, Follow each step and it can help you