![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
css
Dahui_program
这个作者很懒,什么都没留下…
展开
-
css实现垂直水平同时居中的方法
1.父元素设置成table,子元素设置成table-cell .father { display:table; text-align:center; } .child { display:table-cell; vertical-align:middle; } *vertical-align:middle ——只对table元素有效 2.利用定位 + transform .father { position:relative; } .child {原创 2021-10-19 21:15:45 · 138 阅读 · 0 评论 -
css中 a标签的4种常用伪类
伪类:为某些选择出来的元素添加同样的样式 对于a标签,可以设置悬停、点击、已激活、未激活四种状态时的效果 /* 未激活 */ a:link { background-color: tomato; } /* 已激活 */ a:visited { background-color: #333; } /* 悬停 */ a:hover { background-color: royalblue; }原创 2021-10-16 12:58:14 · 1058 阅读 · 2 评论