Web--9月29日随笔

一.补充小知识点

css可以继承的样式有:

Font系列,colo,text系列,line-height。

二.

white-space(规定段落中的文本换不换行,nowrap不换行)

word-wrap属性允许长的内容可以自动换行   ,属性值是break-word;

三.写三角形(宽高必须是0):

div{

width:0;

height:0;

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的值为负数。

原文地址:https://www.cnblogs.com/lovels/p/9726897.html