javascript - How to always fix a div in a certain position; no matter how the screen and resolution change; the div position will always remain the same
世界只因有你
世界只因有你 2017-06-24 09:43:50
0
4
780

How to fix a p in a certain position; no matter how the screen and resolution change; the position of p will always remain unchanged

世界只因有你
世界只因有你

reply all(4)
三叔

Add position to p: fixed

刘奇

position: static | relative | absolute | fixed |
static:
Objects follow regular flow. At this time, the 4 positioning offset attributes will not be applied.
relative:
The object follows the regular flow, and it will not affect any elements in the regular flow when it is offset with reference to its position in the regular flow through the four positioning offset attributes of top, right, bottom, and left.
absolute:
The object breaks away from the regular flow. At this time, the offset attribute refers to the positioned ancestor element closest to itself. If there is no positioned ancestor element, it goes back to the body element. The box's offset position does not affect any elements in the regular flow, and its margins are not collapsed with any other margins.
fixed:
Same as absolute, but the offset positioning is based on the window. When scroll bars appear, objects do not scroll.

我想大声告诉你

Give me a fixed left, top, etc.

仅有的幸福

The p position needs to remain unchanged

The percentage will definitely not work,

Recommended units:

  • px

  • rem

Theoretically position is required:

  • cannot be statuc

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!