一.补充小知识点css
css能够继承的样式有:布局
Font系列,colo,text系列,line-height。spa
二.继承
white-space(规定段落中的文本换不换行,nowrap不换行)it
word-wrap属性容许长的内容能够自动换行 ,属性值是break-word;class
三.写三角形(宽高必须是0):自适应
div{样式
width:0;margin
height:0;static
border-top:5px solid transparent(透明的);
border-right:5px solid transparent(透明的);
border-bottom:5px solid blue;
border-left:5px solid transparent(透明的);
}
箭头面向右边就写左边框,面左就写有边框。箭头面向上边就写下边框,箭头面向下边就写上边框。
四.
margin对布局的影响 双飞翼布局 圣杯布局
双飞翼布局:中间固定,两边auto(自适应);
圣杯布局:两边固定,中间auto(自适应);
Margin是 外边距,属性值是数字 数字又分正负。
正数:margin:20px;
负数:在static元素中(标准流下)margin-left为负数当前元素向左走 margin-top为负当前元素向上走
Margin-bottom为负数后当前元素不动后面的元素向上走,margin-right为负数当前元素不动后面的元素向左走
注意的,margin为负会增大当前元素的宽(前提是当前元素没有设置width),在ul,li中,设置ul的margin-right:-20px;宽增长20px。
场景:
后面两个元素上不去了,设置ul的margin-right的值为负数。