CSS implementation follows the floating layer of the scroll bar

Source: Internet
Author: User

Accidentally passing by the Firefox community finds that their floating layer following the scroll bar is smoother than they did before,

Naturally, I'm curious to use Firebug to analyze its structure:

1. At first, I felt like I was writing the same principle. I used the following to control the floating layer display position.

View sourceprint? Top: 0;

Position: absolute;

2. Compared with my own, I found that the Top: 0 in the Firefox community has never changed.

The scroll bar changes the value.

3. Paste its CSS and Html code. If Javascript control is absent, CSS will play a magical role.

The useless CSS statements are deleted layer by layer until the header style is deleted. The floating layer does not scroll with the scroll bar,

The following three lines of code determine that the floating layer follows

View sourceprint? Padding: 10px 0 0;

Position: fixed;

Width: 300px;

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.