【发布时间】:2022-01-04 14:09:21
【问题描述】:
我将页脚放在 col-md-12 容器的最后一行,并希望页脚与 col-md-12 容器的宽度相同。相反,它正确地从容器的左侧开始,但在右侧结束于显示边框而不是容器。
<html>
<head>
<title>footertest</title>
<!-- bootstrap -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<style>
.myleft{
width: 100%;
background-color: rgb(227, 236, 97);
height: 400px;
}
.myright{
width: 100%;
background-color: rgb(19, 197, 49);
min-height:100%;
}
.mytest{
width: 100%;
background-color: aqua;
height:50px;
position:fixed;
bottom:0;
}
</style>
</head>
<body>
<div class="container">
<div class="row " > <!-- arbeitsbereich links + rechts- -->
<div class="col-md-6 myleft"> <!-- linke Haelfte -->
this is the left side (col-md-6)
</div>
<div class="col-md-6 myright" > <!-- test1 hat den style lightblue im css-->
<!-- rechte Haelfte-->
this is the right side (col-md-6)
</div>
</div>
<div class="row " >
<div class="col-md-12 mytest">
this is my footer. It starts correctly at the left side of the container, but ends at the right site of the display instead of the container
</div>
</div>
</div>
</body>
</html>
这是结果的截图:
【问题讨论】:
标签: footer