第一种:将固定大小的div框相对窗口水平垂直居中,改变浏览器窗口大小时,依然保持水平垂直居中;
复制代码代码如下: <!doctype html> <html lang=”en”> <head> <title>水平垂直居中</title> <meta charset=”utf-8″> <style type=”text/css”> .out{width: 0px; height: 0px; position: absolute; left: 50%; top: 50%; } .in{height: 300px; width: 300px; position: absolute; left: