常用属性

134 阅读1分钟
  • 鼠标为小手状 cursor: pointer;
  • 透明色 color: transparent;
不透明度 opacity
  • 不透明 opacity: 1;

  • 透明 opacity: 0;

  • 去除背景 background: none;

  • 去除input元素被聚焦时的外围轮廓 outline: none;/outline: 0;

  • 限制盒子最小宽度 min-width: px;

  • 文字向两侧对齐,对最后一行无效 text-align: justify;

  • 切换为border-box: width 和 height 属性包括内容,内边距和边框,但不包括外边距。 box-sizing: border-box;

vertical-align

用来指定行内元素(inline)或表格单元格(table-cell)元素的垂直对齐方式。

  • 使元素相对其父元素垂直对齐 vertical-align: middle;