Answer the question
In order to leave comments, you need to log in
How valid is js for content alignment?
Good evening everyone.
I study the web, I look at different ways to organize the content of the site. Including the problem of the footer sticking to the screen base. One of the most publicized ways is to use the display:table property with an impressive wrapper layer that assigns display:table-row and table-cell.
It works, but it looks cumbersome and not visual enough, so I tried to make an alternative. How it works - we introduce a wrapper div for the main content, then we create a script that hangs a handler on loading and changing the page size that requests the height of the screen, header and footer, and based on them calculates the height of the block for the content.
Answer the question
In order to leave comments, you need to log in
Learn to typeset.
An example of a solution to your problem 1
An example of a solution to your problem 2
JavaScript is acceptable only where it is indispensable or its use would be a simpler and more rational solution.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question