Bootstrap 自适应页脚图像对齐
Bootstrap responsive footer image align
我正在制作响应式页脚,但卡在页脚中的图片处。
左侧(红色)目前还好,没有响应,但这是以后的事情。在右边的(蓝色)我想要图像,三个圆圈向右浮动,就像左边的那个但比向右浮动。但我无法完成它。
我上传的第二张图片是页脚中的图片,我无法在代码段中获取。有人有想法吗?
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<style>
.nopadding {
padding: 0 !important;
margin: 0 !important;
bottom: 0 !important;
}
#footer{
width: 100%;
height: 80px;
background-color: black;
bottom: 0;
left: 0;
position: absolute;
}
#links{
background-color: red;
}
#rechts{
background-color: blue;
float: right;
}
#links img{
width: 20%;
float: left;
margin-top: 6%;
margin-right: 7.5%;
}
#links p{
color: white;
font-weight: bold;
font-size: 1.2em;
margin-left: 5%;
line-height: 80px;
margin-bottom: -0.1em;
}
#rechts img{
width: 20%;
//float: right;
margin-top: 6%;
margin-right: 7.5%;
position: relative;
}
#rechts p{
color: white;
//text-align: right;
float: right;
font-weight: bold;
font-size: 1.2em;
margin-left: 5%;
line-height: 80px;
margin-bottom: -0.1em;
}
/* Medium devices (desktops, 992px and up) */
@media (min-width: 767px) and (max-width : 992px) {
}
/* Large devices (large desktops, 1200px and up) */
@media (max-width: 1200px) {
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-12" id="footer">
<div class="row">
<div class="col-md-3">
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-6 nopadding" id="links">
<img src="img/footer.png"><p>EXAMPLE 100A, 1234 AB EXAMPLE</p>
</div>
<div class="col-md-6 nopadding" id="rechts">
<img src="img/footer.png"><p>TEL. +01 (2)345-678912</p>
</div>
</div>
</div>
<div class="col-md-3">
</div>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js "></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js "></script>
</body>
我拍了2张照片
1) 这是页脚的左图。
2) 这是页脚的右图。
现在将这 2 个图像连接到一个 (col-)div 中,您将得到如这些图像所示的输出
注意:我还根据您的屏幕使其响应size.If需要更改然后问我。
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js "></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js "></script>
<style>
div.img1{
background-image:url("footerimage1.png");
background-repeat:no-repeat;
background-size:cover;
height:150px;
}
div.img2{
background-image:url("footerimage2.png");
background-repeat:no-repeat;
background-size:cover;
height:150px;
}
.heading1{
margin-top:75px;
text-align:right;
color:#fff;
font-weight:900;
}
.heading2{
margin-top:75px;
text-align:right;
color:#fff;
font-weight:900;
}
@media only screen and (max-device-width: 768px) and (orientation: portrait){
div.img1{
background-image:url("footerimage1.png");
background-repeat:no-repeat;
background-size:cover;
height:150px;
width:50%;
float:left;
}
div.img2{
background-image:url("footerimage2.png");
background-repeat:no-repeat;
background-size:cover;
height:150px;
width:50%;
float:left;
}
.heading1{
margin-top:75px;
text-align:right;
color:#fff;
font-weight:900;
font-size:11px;
}
.heading2{
margin-top:75px;
text-align:right;
color:#fff;
font-weight:900;
font-size:11px;
}
}
@media only screen and (max-device-width: 1024px) and (orientation: landscape){
.heading1{
margin-top:75px;
text-align:right;
color:#fff;
font-weight:900;
font-size:12px;
}
.heading2{
margin-top:75px;
text-align:right;
color:#fff;
font-weight:900;
font-size:14px;
}
}
@media only screen and (max-device-width: 414px) and (orientation: portrait){
div.img1{
background-image:url("footerimage1.png");
background-repeat:no-repeat;
background-size:cover;
height:230px;
width:100%;
}
div.img2{
background-image:url("footerimage2.png");
background-repeat:no-repeat;
background-size:cover;
height:230px;
width:100%;
}
.heading1{
margin-top:90px;
text-align:right;
color:#fff;
font-weight:900;
font-size:28px;
}
.heading2{
margin-top:90px;
text-align:right;
color:#fff;
font-weight:900;
font-size:28px;
}
}
/* Medium devices (desktops, 992px and up) */
@media (min-width: 767px) and (max-width : 992px) {
div.img1{
background-image:url("footerimage1.png");
background-repeat:no-repeat;
background-size:cover;
height:230px;
width:50%;
float:left;
}
div.img2{
background-image:url("footerimage2.png");
background-repeat:no-repeat;
background-size:cover;
height:230px;
width:50%;
float:left;
}
.heading1{
margin-top:170px;
text-align:center;
color:#fff;
font-weight:900;
font-size:18px;
}
.heading2{
margin-top:170px;
text-align:center;
color:#fff;
font-weight:900;
font-size:18px;
}
}
/* Large devices (large desktops, 1200px and up) */
@media (max-width: 1200px) {
.heading1{
margin-top:60px;
text-align:right;
color:#fff;
font-weight:900;
font-size:16px;
}
.heading2{
margin-top:60px;
text-align:right;
color:#fff;
font-weight:900;
font-size:18px;
}
}
</style>
</head>
<body>
<footer>
<div class="row">
<div class="col-lg-6 col-md-6 img1">
<h4 class="heading1">Example 100A, 1234 AB EXAMPLE</h4>
</div>
<div class="col-lg-6 col-md-6 img2">
<h4 class="heading2">TEL. +01(2)345-678912</h4>
</div>
</div>
</footer>
</body>
</html>
我正在制作响应式页脚,但卡在页脚中的图片处。
左侧(红色)目前还好,没有响应,但这是以后的事情。在右边的(蓝色)我想要图像,三个圆圈向右浮动,就像左边的那个但比向右浮动。但我无法完成它。
我上传的第二张图片是页脚中的图片,我无法在代码段中获取。有人有想法吗?
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<style>
.nopadding {
padding: 0 !important;
margin: 0 !important;
bottom: 0 !important;
}
#footer{
width: 100%;
height: 80px;
background-color: black;
bottom: 0;
left: 0;
position: absolute;
}
#links{
background-color: red;
}
#rechts{
background-color: blue;
float: right;
}
#links img{
width: 20%;
float: left;
margin-top: 6%;
margin-right: 7.5%;
}
#links p{
color: white;
font-weight: bold;
font-size: 1.2em;
margin-left: 5%;
line-height: 80px;
margin-bottom: -0.1em;
}
#rechts img{
width: 20%;
//float: right;
margin-top: 6%;
margin-right: 7.5%;
position: relative;
}
#rechts p{
color: white;
//text-align: right;
float: right;
font-weight: bold;
font-size: 1.2em;
margin-left: 5%;
line-height: 80px;
margin-bottom: -0.1em;
}
/* Medium devices (desktops, 992px and up) */
@media (min-width: 767px) and (max-width : 992px) {
}
/* Large devices (large desktops, 1200px and up) */
@media (max-width: 1200px) {
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-12" id="footer">
<div class="row">
<div class="col-md-3">
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-6 nopadding" id="links">
<img src="img/footer.png"><p>EXAMPLE 100A, 1234 AB EXAMPLE</p>
</div>
<div class="col-md-6 nopadding" id="rechts">
<img src="img/footer.png"><p>TEL. +01 (2)345-678912</p>
</div>
</div>
</div>
<div class="col-md-3">
</div>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js "></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js "></script>
</body>
我拍了2张照片
1)
现在将这 2 个图像连接到一个 (col-)div 中,您将得到如这些图像所示的输出
注意:我还根据您的屏幕使其响应size.If需要更改然后问我。
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js "></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js "></script>
<style>
div.img1{
background-image:url("footerimage1.png");
background-repeat:no-repeat;
background-size:cover;
height:150px;
}
div.img2{
background-image:url("footerimage2.png");
background-repeat:no-repeat;
background-size:cover;
height:150px;
}
.heading1{
margin-top:75px;
text-align:right;
color:#fff;
font-weight:900;
}
.heading2{
margin-top:75px;
text-align:right;
color:#fff;
font-weight:900;
}
@media only screen and (max-device-width: 768px) and (orientation: portrait){
div.img1{
background-image:url("footerimage1.png");
background-repeat:no-repeat;
background-size:cover;
height:150px;
width:50%;
float:left;
}
div.img2{
background-image:url("footerimage2.png");
background-repeat:no-repeat;
background-size:cover;
height:150px;
width:50%;
float:left;
}
.heading1{
margin-top:75px;
text-align:right;
color:#fff;
font-weight:900;
font-size:11px;
}
.heading2{
margin-top:75px;
text-align:right;
color:#fff;
font-weight:900;
font-size:11px;
}
}
@media only screen and (max-device-width: 1024px) and (orientation: landscape){
.heading1{
margin-top:75px;
text-align:right;
color:#fff;
font-weight:900;
font-size:12px;
}
.heading2{
margin-top:75px;
text-align:right;
color:#fff;
font-weight:900;
font-size:14px;
}
}
@media only screen and (max-device-width: 414px) and (orientation: portrait){
div.img1{
background-image:url("footerimage1.png");
background-repeat:no-repeat;
background-size:cover;
height:230px;
width:100%;
}
div.img2{
background-image:url("footerimage2.png");
background-repeat:no-repeat;
background-size:cover;
height:230px;
width:100%;
}
.heading1{
margin-top:90px;
text-align:right;
color:#fff;
font-weight:900;
font-size:28px;
}
.heading2{
margin-top:90px;
text-align:right;
color:#fff;
font-weight:900;
font-size:28px;
}
}
/* Medium devices (desktops, 992px and up) */
@media (min-width: 767px) and (max-width : 992px) {
div.img1{
background-image:url("footerimage1.png");
background-repeat:no-repeat;
background-size:cover;
height:230px;
width:50%;
float:left;
}
div.img2{
background-image:url("footerimage2.png");
background-repeat:no-repeat;
background-size:cover;
height:230px;
width:50%;
float:left;
}
.heading1{
margin-top:170px;
text-align:center;
color:#fff;
font-weight:900;
font-size:18px;
}
.heading2{
margin-top:170px;
text-align:center;
color:#fff;
font-weight:900;
font-size:18px;
}
}
/* Large devices (large desktops, 1200px and up) */
@media (max-width: 1200px) {
.heading1{
margin-top:60px;
text-align:right;
color:#fff;
font-weight:900;
font-size:16px;
}
.heading2{
margin-top:60px;
text-align:right;
color:#fff;
font-weight:900;
font-size:18px;
}
}
</style>
</head>
<body>
<footer>
<div class="row">
<div class="col-lg-6 col-md-6 img1">
<h4 class="heading1">Example 100A, 1234 AB EXAMPLE</h4>
</div>
<div class="col-lg-6 col-md-6 img2">
<h4 class="heading2">TEL. +01(2)345-678912</h4>
</div>
</div>
</footer>
</body>
</html>