sanlangguo / learn-notes

学习笔记
16 stars 1 forks source link

工作中常用的 CSS 技巧 #22

Open sanlangguo opened 2 years ago

sanlangguo commented 2 years ago

0.5px 边框

div {
    width: 64px;
    height: 25px;
 }

div::after {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  transform: scale(0.5);
  border-radius: 4px;
  border: 1px solid #F24C3D;
}

css 显示省略号

overflow:hidden; //超出的文本隐藏
text-overflow:ellipsis; //溢出用省略号显示
white-space:nowrap; //溢出不换行