前端知识小札

1.清除元素的浮动属性

p:元素A有float属性,其它元素会受其影响

s:在其父元素添加clearfix属性,它的CSS样式为:

.clearfix:after {
content: " "; /* Older browser do not support empty content */
visibility: hidden;
display: block;
height: 0;
clear: both;
}

 

2.纯css实现下拉图标

border-top4px solid;

border-right: 4px solid transpant;

border-left: 4px solid transpant;

 

3.换行

强制不换行: div { white-space: no-wrap; }

自动换行: div { word-wrap: break-word; word-break: normal; }

强制英文单词断行: div { word-break: break-all; }

 

你可能感兴趣的:(前端)