Can you tell me how to use CSS to realize that the height changes with the width, keeping the aspect ratio unchanged, and the width changes according to the width of the parent element?

  css3, question

Excuse me, how can CSS be used to change the height with the width, keeping the aspect ratio consistent, and the width is changed according to the width of the parent element?

Both: width:20%

In the year of Sao, a few months ago, I once found a strange erotic technique in a high mountain and secluded place that I could see. However, this kind of skill is of no use to you. Remember it!

html:
 
 
 <div class = "father">
 < divclass = "daugher" > </div >//father and daughter are deeply in love.
 </div>
 
 
 
 css:
 .father {
 width: 70%;
 }
 .daughter {
 width: 90%;   height: 0;
 padding-top: 60%;
 background: black;
 }

This kind of skill only makes people have some deep understanding of a certain knowledge point. Here is to let people know that the percentage value of top-bottom margin is based on the width of the parent element.
If you want to realize the conditions in your topic, it is very simple to use js. You don’t have to go to great lengths to try your best to use css.