一些Css记录

蓝湖:指定宽度:1875px

padding不能使用负值
background: -webkit-linear-gradient(to right, #6291E0 , #64ACE7);
background: linear-gradient(to right, #6291E0 , #64ACE7);

自动换行:
      white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

   display: flex;
    display: -webkit-flex;
    justify-content: center;
    -webkit-justify-content: center;
    align-items: center;
    -webkit-align-items: center;

    justify-content: space-between;
    -webkit-justify-content: space-between;
    justify-content:space-around;

  align-self: flex-end;
  align-self:center;
  flex-direction: column;

autofocus属性:不用用户按鼠标就可以直接聚焦。适用于所有<input>标签的类型。
<input type="text" name="text" autofocus="autofocus"/>

box-shadow: 0px -2px 5px 0px #e6e6e6;
li{
    list-style:none;
}


在display布局中,使用flex:1,那么能够让这一部分自适应剩余宽度。
当flex布局的时候,使用flex:1的部分,如过用white-space:nowrap那么布局会错乱。这时候给flex:1的部分加上min-width:0,就可以了。
参考:https://blog.csdn.net/honiler/article/details/81155026

垂直居中:

// 方法1
.wraper {
  position: relative;
  .box {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    margin: -50px 0 0 -50px;
  }
}
// 2
.wraper {
  position: relative;
  .box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}
// 3
.wraper {
  .box {
    display: flex;
    justify-content:center;
    align-items: center;
    height: 100px;
  }
}

双向绑定:

<input id="input"/>
const data = {};
const input = document.getElementById('input');
Object.defineProperty(data, 'text', {
  set(value) {
    input.value = value;
    this.value = value;
  }
});
input.onChange = function(e) {
  data.text = e.target.value;
}
jsp中使用vue
[v-cloak] {
  display:none !important;
}

修改placeholder默认颜色

input:-moz-placeholder,
textarea:-moz-placeholder { 
    color: #fff;
}
input:-ms-input-placeholder,
textarea:-ms-input-placeholder { 
    color: #fff;
}
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder { 
    color: #fff ;
} 
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 主键,外键,超键,候选键 数据库事务的四个特征及含义 视图的作用,可以更改吗 视图是虚拟的表;只包含动态检索数据的...
    DamaoShao阅读 6,333评论 0赞 3
  • 更新下 把我之前写的demo找到了放到git上面了地址 最近时间一直在研究ibeacon所以把自己遇到的一些问题写...
    沙瓦迪卡阅读 21,510评论 53赞 55
  • 问答题47 /72 常见浏览器兼容性问题与解决方案? 参考答案 (1)浏览器兼容问题一:不同浏览器的标签默认的外补...
    _Yfling阅读 14,413评论 1赞 92
  • 1、是什么浮动? 浮动是CSS的一种属性,float会让元素左右移动,直到它的外边缘碰到它的包含框或者另一个浮动元...
    陈智涛阅读 542评论 0赞 0
  • 我们在会所找出了一盘冰冻虾,下厨房烧了一下,配红酒加火腿美味无比。如果没有张晓康,这盘虾就不存在。
    少林寺Shirley阅读 241评论 0赞 0

友情链接更多精彩内容