wordpress手機圖片站蘇州百度代理公司
?一、relative
相對原先的位置進(jìn)行定位
{position: relative;left: 50px; /* 相對原先位置左邊的距離 */top: 100px; /* 相對原先位置上邊的距離 */
}
二、absolute
絕對定位,是相對于最近有定位的父級元素進(jìn)行定位
{position: absolute;right: 50px; /* 右邊距離父級元素的距離 */bottom: 100px; /* 下邊距離父級元素的距離 */
}
三、fixed
固定定位,不會隨著頁面滾動而滾動,相當(dāng)于定在了頁面上
{position: fixed;left: 50px; /* 距離頁面最左側(cè)的距離 */top: 100px; /* 距離頁面最上邊的距離 */
}
四、sticky
粘性定位,在沒到達(dá)指定位置之前會進(jìn)行滾動,到達(dá)指定位置會定在頁面上
{position: sticky;top: 20px; /* 距離頁面上邊20px時粘定,可以換成left、right、bottom */
}