Home > Web Front-end > HTML Tutorial > How to control the content in a DIV box so that when the user pulls the browser scroll bar, the content in the div can scroll accordingly_html/css_WEB-ITnose

How to control the content in a DIV box so that when the user pulls the browser scroll bar, the content in the div can scroll accordingly_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:51:09
Original
1514 people have browsed it

Now there is a centered div. When the content is higher than this div, how to make the browser have a scroll bar and scroll the content of the DIV? Please code


Reply to the discussion (Solution)

You can make the DIV have a scroll bar when it exceeds the height. The browser's scroll bar controls the entire document. If you add control to the document, once the content of the entire page is too large, then you Whether the scroll bar controls the DIV or the document is easy to be confused

Therefore, it is best to add restrictions to the DIV, or you can define the scroll bar yourself to simulate

Now there is a centered When the content of a div is higher than this div, how can I make the browser have a scroll bar and scroll the content of the DIV? What restrictions should be added to the code




? It is impossible for this centered div to set the overflow attribute, so it will have a scroll bar effect in the div area.
What I want is this effect as shown

Could you please tell me, has the problem been solved

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template