In this year, a few months ago, I found a strange obscene technique in a remote place in a high mountain that you can have a look at. However, such techniques are of no use, so remember!
Such techniques only give people some in-depth understanding of a certain knowledge point. What I want people to understand here is that the percentage values of the top and bottom margins are based on the width of the parent element as a reference.
If you want to realize the conditions in your question, use js, which is very simple. There is no need to rack your brains to implement it with css.
Add onehttp://jsbin.com/kufuwaxiji/1/edit?html,output
The width and height remain unchanged. For your reference, the content must be absolutely positioned
In this year, a few months ago, I found a strange obscene technique in a remote place in a high mountain that you can have a look at. However, such techniques are of no use, so remember!
Such techniques only give people some in-depth understanding of a certain knowledge point. What I want people to understand here is that the percentage values of the top and bottom margins are based on the width of the parent element as a reference. If you want to realize the conditions in your question, use js, which is very simple. There is no need to rack your brains to implement it with css.Add onehttp://jsbin.com/kufuwaxiji/1/edit?html,output The width and height remain unchanged. For your reference, the content must be absolutely positioned
JS
Let’s do it Standard cannot be achieved. If you really need it, the magic can still be achieved.