Html 响应性设计定位跨度
我有两个带内联块显示的跨距,在响应模式下(分辨率低于768X1024),我需要将一个跨距置于另一个跨距之上,以便将显示设置为块,但错误的跨距位于顶部如何使第二个跨距位于顶部Html 响应性设计定位跨度,html,css,responsive-design,Html,Css,Responsive Design,我有两个带内联块显示的跨距,在响应模式下(分辨率低于768X1024),我需要将一个跨距置于另一个跨距之上,以便将显示设置为块,但错误的跨距位于顶部如何使第二个跨距位于顶部 感谢使用浮动:左在上你想在顶部。唯一的方法是在html代码中向上移动#login内容,另一方面,你可以使用绝对位置来设置它们的位置。考试: #attensions{ position: absolute; top: 180px; } #loginContent{ position: absolute;
感谢使用
浮动:左在上你想在顶部。唯一的方法是在html代码中向上移动#login内容,另一方面,你可以使用绝对位置来设置它们的位置。考试:
#attensions{
position: absolute;
top: 180px;
}
#loginContent{
position: absolute;
top: 0;
}
查看此变体是否有帮助:
重要的是,我在HTML中翻转了两个div的顺序,然后使用CSS来管理布局
CSS
/* pull the first div to the right and the second to the left for desktop views */
#loginContent{
width:330px;
float:right;
}
#attensions{
width:330px;
float:left;
}
.LgnBtn{
clear:both;
}
/* for tablets and smartphones, remove the floats above */
@media (max-width: 790px){
#loginContent{
width:100%;
float:inherit;
}
#attensions{
width:100%
float:inherit;
}
}
希望这有帮助 我已经试过了,没有收获:|你能用你的代码创建一个jsfiddle吗?有两个跨度#Attentions和#loginContent,当你调整它的大小时#Attentions在上面我需要#loginContent在上面为什么不移动#loginContent
上面的HTML#Attentions
?这样:我不能,因为在正常模式下,他们的位置不能改变:/