Html 用css在网页上定位对象

Html 用css在网页上定位对象,html,css,Html,Css,如果我创建一个按钮,我将如何将它定位在我想要的网页上,而不仅仅是定位在没有内容的网页上 使用使用绝对定位 例: 它刚刚离开:10px;顶部:20px就足够了,用保证金定位不是一个合适的方式,谢谢 position:absolute; //Place wherever we want on the page left-margin:10px; //Move right 10px top-margin:20px; //Move down 20px z-index:2; //Put on top of

如果我创建一个按钮
,我将如何将它定位在我想要的网页上,而不仅仅是定位在没有内容的网页上

使用

使用绝对定位

例:


它刚刚离开:10px;顶部:20px就足够了,用保证金定位不是一个合适的方式,谢谢
position:absolute; //Place wherever we want on the page
left-margin:10px; //Move right 10px
top-margin:20px; //Move down 20px
z-index:2; //Put on top of everything with z-index of 1 or 0