我是新来的,并且使用CSS。我试图将我的页脚放在内容部分下。每当内容变大时,页脚将根据内容设置其位置。但我不能这样做。 这是该网站的图片。我希望它是双面网站,适合内容,留给推文。当你看到页脚如何出现时。
实际上,当我将Aside的浮点值设置为右时,Footer就会出现。当它没有时,Footer就像我想要的那样工作。
这些是代码:
内容来到这里 推文来到这里
这些是CSS代码:
@Override
public void onBackPressed() {
super.onBackPressed();
ActivityCompat.finishAffinity(MainActivity.this);
android.os.Process.killProcess(android.os.Process.myPid());
}
答案 0 :(得分:0)
在你的CSS中明确你的页脚:两者
此外,如果你想要你的部分和旁边的块并排,你可以将它们向左浮动,它们的组合宽度(包括边距)应该是100%..或更少
https://jsfiddle.net/sgey3698/1/
section {
float: left;
width: 55%;
margin-right: 5%;
background: white;
padding-top: 10px;
}
aside {
width: 40%;
padding-top: 10px;
float: left;
}
footer {
height: 30px;
background-color: #ca171b;
border-radius: 10px;
border-bottom-style: groove;
border-bottom-color: rgba(0,0,0,1);
border-bottom-width: 8px;
border-left-style: ridge;
border-left-color: rgba(0,0,0,1);
border-left-width: 3px;
border-right-width: 3px;
border-right-style: ridge;
border-right-color: rgba(0,0,0,1);
font-family: "Arial Rounded MT Bold";
font-size: 1.2em;
color: #FFFFFF;
text-align: center;
font-weight: bold;
margin: 5%;
padding-top: 5px;
padding-bottom: 5px;
z-index: 1;
clear: both;
}