Anyone tell me that how to fix all elements with css, means whatever we do with the browser's height and width then elements should not move? or elements should not move relative to the browser' height and width and page should also be scroll able?
Applying position: absolute
to an element will cause it remain fixed relative to the document. That is, it will scroll with the document.
Applying position: fixed
will cause it to remain fixed relative to your browser window. That is, if you scroll the document it will not move.
With each of these position
values, you can specify some combination of top
, right
, bottom
and left
to specify their position. For example, the following style will fix an element very close to the top right of the browser window (it will not scroll with the document):
.topright {
position: fixed;
top: 5px;
right: 5px;
}