![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
css
wenster1993
这个作者很懒,什么都没留下…
展开
-
inline-block实现元素水平居中
demo<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> *{ margin: 0; padding: 0; } ul { list-style: none outside none; paddin转载 2015-07-27 17:09:40 · 2374 阅读 · 0 评论 -
margin:auto实现绝对定位元素的水平垂直居中
垂直水平居中.element { width: 600px; height: 400px; position: absolute; left: 0; top: 0; right: 0; bottom: 0; margin: auto; /* 有了这个就自动居中了 */ }垂直居中 利用行高(line-height)定位 利用绝对定位 元素的宽度/2 = 负左边距 元转载 2015-07-27 17:15:14 · 327 阅读 · 0 评论