Skip to content

Instantly share code, notes, and snippets.

@movever
movever / gist:7446482
Last active December 28, 2015 04:59
fixed
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
.wrap{width:500px;position:relative;margin:0 auto;height:2000px;background:green;}
.to-top-container{position:absolute;bottom:0px;right:-20px;}
.to-top{position:fixed;bottom:20px;}
.extend .to-top{margin-left:1px;}/*没有这一行 to-top不会随着wrap移动*/
/*css3*/