2014年3月18日 星期二

DIV 置中

DIV 置中

參考源原:http://www.wibibi.com/

DIV 置中方式主要是讓整個 DIV 區塊置中
margin:0px auto;   <-- div="" p="">

DIV 內的元素置中,如果你想要讓 DIV 內的文字、圖片或其他元素能夠置中,
text-align:center;    //水平置中對齊
line-height100px; //文字垂直置中

-------------------------------------------
CSS position 

position : absolute;
absolute:絕對位置,當網頁往下拉時,元素也會跟著改變位置,其元素的位置由 top、left、right、bottom 所決定。
fixed:元素位置固定,相對於瀏覽器而定位,其元素的位置由 top、left、right、bottom 所決定。
relative:相對位置,相對於其它元素的位置,其元素的位置由 top、left、right、bottom 所決定。
static:這就是預設值,如果設定 position 為 static,則 top、left、right、bottom 會被忽略。
inherit:繼承自父層 position 定位屬性的值。

-------------------------------------------
CSS float 浮動語法

float: 浮動方向;
 left(靠左浮動)、right(靠右浮動)、none(預設值,也就是不浮動)以及 inherit(繼承自父層的屬性)

沒有留言:

張貼留言