Home >Web Front-end >HTML Tutorial >The height is 100%-50px, how should it be set? _html/css_WEB-ITnose
100%
Currently I only know to use JS to get the height of the parent and then subtract 50px. Now I want to use pure CSS to solve it, but I tried online methods and found no suitable methods. This can only be done using JS. First get the height of the web page and then think of a solution
For CSS, CSS5 seems to be OK.
Add an outer layer, and then set the margin-top of the sub-layer to 50px and the outer layer to -50px.