Home >Web Front-end >HTML Tutorial >The height is 100%-50px, how should it be set? _html/css_WEB-ITnose

The height is 100%-50px, how should it be set? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:22:332353browse

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.
Is there any expert who can give me some advice? I would be very grateful

Reply to the discussion (solution)

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn