Html 如何使用css移动对象
请帮我移动上面的物体。我使用了页边空白,但没有工作 CSS HTMLHtml 如何使用css移动对象,html,css,header,Html,Css,Header,请帮我移动上面的物体。我使用了页边空白,但没有工作 CSS HTML 将父类添加到容器元素中,将子类添加到要进一步向上移动的元素中 .parent{ position:relative; } .child{ position:absolute; top: -10px; } 您使用的是top而不是margintop 添加页边空白 section#features .center-box{ display:block; background-color:#22a3
将父类添加到容器元素中,将子类添加到要进一步向上移动的元素中
.parent{
position:relative;
}
.child{
position:absolute;
top: -10px;
}
您使用的是
top
而不是margintop
添加页边空白
section#features .center-box{
display:block;
background-color:#22a3df;
transform: rotate(45deg);
padding:10px;
width:40px;
height:40px;
margin: 13px auto 0;
}
首先给出您的div位置,然后使用top进行定位:
.center-box{
display:block;
background-color:#22a3df;
transform: rotate(45deg);
padding:10px;
width:40px;
height:40px;
margin: 0 auto;
position:Relative;
top:13px;}
你能添加你的代码或演示以便更好地理解吗
section#features .center-box{
display:block;
background-color:#22a3df;
transform: rotate(45deg);
padding:10px;
width:40px;
height:40px;
margin: 13px auto 0;
}
.center-box{
display:block;
background-color:#22a3df;
transform: rotate(45deg);
padding:10px;
width:40px;
height:40px;
margin: 0 auto;
position:Relative;
top:13px;}