标签:class html 垂直 radius oct pos ack doctype 居中
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>实现水平垂直居中</title> <style type="text/css"> .content { width: 100px; height: 100px; background: yellow; position: absolute; top: 50%; left: 50%; border-radius: 5px; transform: translate(-50%,-50%); } </style> </head> <body> <div class="content"></div> </body> </html>
标签:class html 垂直 radius oct pos ack doctype 居中
原文地址:https://www.cnblogs.com/youzhishusheng/p/12337496.html