title |
---|
css 相关 |
-webkit-user-modify: read-write-plaintext-only;
document.getElementsByTagName('html')[0].style.fontSize = document.documentElement.clientWidth/10 + "px";
div{
width:1rem;
height:1rem;
}
<meta name="viewport" content="width=320,initial-scale=1,minimum-scale=1,maximum=1">
<div class="wrapper">
<div class="inner"></div>
</div>
.wrapper {
height: 0;
padding-bottom: 200px;
position: relative;
border: 1px solid #ddd;
}
.inner {
position: absolute;
top: 0;
width: 50%;
height: 50%;
border: 1px dashed #f00;
}
/*因为外层倾斜了之后,内层也会跟着倾斜,所以内层要往相反的方向倾斜*/
.wrapper {
border: 1px solid #44a5fc;
color: #333;
transform: skew(-20deg);
}
.inner {
transform: skew(20deg);
}
word-break:keep-all;
white-space:nowrap;
text-overflow:ellipsis;
解决办法: 两个span的父元素上添加font-size: 0
@media only screen and (-webkit-min-device-pixel-ratio:2) {
.border1px:after {
position: absolute;
height: 1px;
right: 0;
width: 100%;
content: ' ';
transform: scaleY(0.5);
-webkit-transform: scaleY(0.5);
}
}
.gray {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
}
1.页面外层元素不能有固定定位,据对定位是可以的 2.input的高度不能用百分比,或者vh,用vw和px是可以的
<input @focus="move('-20%')">
move(val) {this.distance(val)}
.className{
display: flex;
align-items: center;
}
justify-content: space-evenly;
min-height: fill-available;
要在底部的元素
margin-top: -13.333333vw;
height: 13.333333vw;
::-webkit-scrollbar {
width: 0px;
height: 1px;
}
::-webkit-scrollbar-thumb {
border-radius: 5px;
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: rgba(0, 0, 0, 0.2);
}
[http-equiv属性详解(转)] (http://kinglyhum.iteye.com/blog/827807)
<style>
input::-webkit-input-placeholder{
color:red;
}
input::-moz-placeholder{ /* Mozilla Firefox 19+ */
color:red;
}
input:-moz-placeholder{ /* Mozilla Firefox 4 to 18 */
color:red;
}
input:-ms-input-placeholder{ /* Internet Explorer 10-11 */
color:red;
}
</style>
- 设置了sticky的元素,在屏幕范围(viewport)时该元素的位置并不受到定位影响(设置是top、left等属性无效),当该元素的位置将要移出偏移范围时,定位又会变成fixed,根据设置的left、top等属性成固定位置的效果。
- 缺点:兼容性
<div class="flex-jus">
<!-- 中文后面要跟一个空格 后面要有一个空的span -->
两 端 对 齐<span></span>
</div>
.flex-jus {
text-align: justify;
width: 300px;
height: 100px;
line-height: 100px;
}
.flex-jus span {
display: inline-block;
padding-left: 100%;
}
BFC(Block formatting context)直译为"块级格式化上下文"。它是一个独立的渲染区域,只有Block-level box参与, 它规定了内部的Block-level Box如何布局,并且与这个区域外部毫不相干。
- float属性不为none
- position为absolute或fixed
- display为inline-block, table-cell, table-caption, flex, inline-flex
- overflow不为visible