Asp,Php,Jssdk,mysql,mssql,微信公众号开发,小程序开发-学习笔记 收集日常学习笔记和重点,交流QQ:79657181,手机/微信:18611436777

before以及position:absolute;居中效果

before以及position:absolute;居中效果


<ul class="order">

<li class="active"><a href="1">待付款</a></li>

<li><a href="1">待发货</a></li>

2021年11月12日 | 发布:anco | 分类:css | 评论:0

position居中效果

.pro_ul li{width:15%; height:auto; margin-right:2%; position:relative; border:2px solid #2785cd}

.pro_ul li .title{ position:absolute; top:0; left:0; right:0; bottom:0; width:80%; height:40px; margin:0 auto; background-color:#06C}


2021年2月11日 | 发布:anco | 分类:css | 评论:0

图片垂直水平居中

/*图片垂直水平居中*/

.middleCenter {

  position: absolute;

  top: 0;

  bottom: 0;

  left: 0;

  right: 0;

  max-width: 100%;

  max-height: 100%;

  display: block;

2020年6月12日 | 发布:anco | 分类:css | 评论:0

li标签实现隔行左右则显示(奇数行、偶数行)

.mk_list{ overflow:hidden}

.mk_list li{overflow:hidden;  margin-bottom:30px; background-color:#fbfbfb}


.mk_list li:nth-of-type(odd) .mk_left{ float:left; width:300px; height:225px; overflow:hidden}

.mk_list li:nth-of-type(odd) .mk_right{ float:right; width:850px; height:auto; }

2019年3月27日 | 发布:anco | 分类:css | 评论:0

CSS选取第几个标签元素:nth-child、first-child、last-child

1、first-child


first-child表示选择列表中的第一个标签。代码如下:


li:first-child{background:#090}


上面的意思是,li 列表中的 第一个li模块的背景颜色。


2、last-child


last-child表示选择列表中的最后一个标签,代码如下:


2019年1月15日 | 发布:anco | 分类:css | 评论:0

CSS之精灵图(雪碧图)的使用方法

background:url(../images/img.png) no-repeat 0 -54px;第一个0是指图片在最左侧开始的,后面这个-54px是指从图片上面往下第54个像素开始使用图片

2018年11月24日 | 发布:anco | 分类:css | 评论:0