1. 首页
  2. 数据库
  3. 其它
  4. 绝对定位元素的水平垂直居中的方法(3种任选)

绝对定位元素的水平垂直居中的方法(3种任选)

上传者: 2021-02-01 15:34:25上传 PDF文件 26.78KB 热度 17次
1.css实现居中 缺点:需要提前知道元素的宽度和高度。 <!doctype html> <html lang=en> <head> <meta charset=UTF-8> <title>Document</title> <style> .box{ width: 600px; height: 400px; position: absolute; left: 50%; top: 50
下载地址
用户评论