Web--9月29日隨筆

一.補充小知識點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的值爲負數。

相關文章
相關標籤/搜索