前端小问题,老是记不住

css实现遮罩层,父div透明,子div不透明

给父元素使用 rgba 颜色
单独使用opacity没效果

input 设置 width:100% 和padding后宽度超出父节点

box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;

div等元素height:100%高度不生效

转:https://blog.csdn.net/ann295258232/article/details/54408431

In specific, all percentage-based sizes must inherit from parent block elements, and if any of those ancestors fail to specify a size, they are assumed to be sized at 0 x 0 pixels

具体地讲,所有基于本分比的尺寸必须从父块元素继承,并且如果任一父项未能指定尺寸,则它们的尺寸假定为0 x 0像素

body设置的height:100%要从它的父块元素那里继承,但它的父块元素html没有设置高度
html设置了height:100%后,body和div设置的height:100%便生效了
因为父元素没高度,父元素的父元素也没高度,要同时将body和html都设置高度。

text-indent设置抬头距离css缩进

text-indent设置抬头距离css缩进
letter-spacing设置字符间距

猜你喜欢

转载自blog.csdn.net/Error_plus/article/details/81429052