css tips

作者: 楚阿吉 | 来源:发表于2018-07-04 14:03 被阅读0次

高度不定的情况下,让文字水平居中

display: -webkit-box;
-webkit-box-pack: center;
box-pack: center;
-webkit-box-align: center;
box-align: center;

在内容宽高不定的情况下,让内容居中

position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
-ms-transform: translate(-50%,-50%);
-moz-transform: translate(-50%,-50%);
-o-transform: translate(-50%,-50%);

相关文章

  • 一个webAPP项目的完整记录(vue)

    项目初始化 some Tips 引入外部CSS: @import "../css/base.css";引入外部J...

  • 【css】常用样式&骨架屏

    css css Tips css更多写法 tanform动画 矩阵 图片压缩规则 [x] 阿里云压缩规则:?x-o...

  • css tips

    高度不定的情况下,让文字水平居中 在内容宽高不定的情况下,让内容居中

  • css tips

    .box:first-child和.box :first-child的区别 选择一个class为box的元素,要求...

  • CSS Tips

    1.半透明边框border:10px solid hsla(0,0%,100%,.5);background:wh...

  • CSS Tips

    根据内容调整字体大小 https://github.com/davatron5000/FitText.js[htt...

  • CSS Tips

    垂直居中 display: relative如果父类有设置高度可以尝试 (height: 100%也可以) 没有的...

  • 自制html+css+js自适应弹出框

    html 部分 css 部分 JS部分 Tips:引入样式前加入了reset.css进行了样式重置

  • CSS常用tips

    autocomplete="off"表单输入禁用autocomplete

  • tips之css

    CSS3 :not()选择器 自定义超出N行用...代替.ellipsis-row(n){overflow:hid...

网友评论

      本文标题:css tips

      本文链接:https://www.haomeiwen.com/subject/zsyeuftx.html