This article explains the position:fixed implementation of HTML elements to a certain location through an example. Instance div will be fixed in the bottom right corner of the Web page, the main use of CSS position:fixed properties, the need for the Code farmers can refer to.
CSS implementation div Fixed in the bottom right corner of the page instance code:
The effect of pinning an element to the lower-right corner of a webpage is very frequent, such as a button that returns to the top, or an informational cue box, which describes how to use CSS to achieve this effect, as shown in the following code example:
<!DOCTYPE HTML><HTML><Head><title>CSS position:fixed Implementing HTML elements fixed to a location</title><styletype= "Text/css">*{padding:0;margin:0;}Body{Height:1000px;}#footer{position:fixed;background:#eee;Bottom:20px; Right:10px;width:100px;Height:100px;}</style></Head><Body><DivID= "Footer"></Div></Body></HTML>
Run online
The above code implements our requirements, the DIV block can be fixed in the bottom right corner of the page, whether or not to drag the scroll bar.
Original address: http://www.manongjc.com/article/292.html
CSS position:fixed Implementing HTML elements fixed to a location