摘要: 水平居中: 1、针对文字:text-align 2、针对已知宽高块级容器:margin-left、margin-right 3、不知道宽高:position+translate 4、终极解决方案(文字和容器均可):flex布局 垂直居中: 1、固定高度的单行文本:line-height 2、不知道宽高:position+margin-top(知道高度的px)/translate 3、fl... 阅读全文
posted @ 2019-10-09 22:50 是桂 阅读(529) 评论(0) 推荐(0) 编辑
摘要: .text-ellipsis /* { 单行文字溢出省略 */ overflow: hidden; /* 溢出隐藏 */ text-overflow: ellipsis; /* 文字溢出省略 */ white-space: nowrap; /* 文字不换行 */ } .multiline-ellip 阅读全文
posted @ 2019-10-09 22:49 是桂 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 方法1、部分浏览器的<meta>标签加上width=device-width就能解决。 方法2、引入fastclick.js库 阅读全文
posted @ 2019-10-09 17:41 是桂 阅读(317) 评论(0) 推荐(0) 编辑