css - 在页脚标签中,即图像的最后,我想要一个在左边(紧急联系人)和另一个在右边(在线顾问)???怎么做?
问题描述
<!Doctype html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css\font-awesome.min.css">
<title>Welcome to Login</title>
<link rel="stylesheet" type="text/css" href="css\style.css">
</head>
<body>
<div class="container-fluid">
<div class="row">
<img class="bgimg" src="images\bg5.jpg" />
<div class="lgform">
<div class="lglogo col-md-12">
<font class="col-md-6" face="Times New Roman" size="48px">MAS</font>
<img class="logo col-md-6" src="images\logo2.png" />
</div><br><br><br>
<div>
<i class="fa fa-id-card col-md-2" style="font-size:20px;color:green"></i>
<select class="col-md-9">
<option>Select a Document</option>
<option>id number</option>
</select>
</div><br>
<div>
<i class="fa fa-user-o col-md-2" style="font-size:20px;color:green"></i>
<input class="col-md-9" type="number" placeholder="Number Document" />
</div><br>
<div>
<i class="fa fa-key col-md-2" style="font-size:20px;color:green"></i>
<input class="col-md-9" type="password" placeholder="Password" />
</div><br>
<div>
<center>
<a href="index.html">
<input class="btn btn-primary col-md-6" type="submit" value="LOGIN" style="font-weight:bold" />
</a>
</center>
<center>
<a href="registration.html">
<br><input class="btn btn-danger col-md-6" type="submit" value="Create an Account! New User?" style="font-weight:bold" />
</a>
</center>
</div><br>
<div class="col-md-7" style="margin-left:100px">
<a href="forgotpsw.html">¿Forgot Password?</a>
<a href="help.html" style="float:right">¿Help?</a>
</div><br><br>
</div>
<footer>
<div class="container-fluid">
<div class="row">
<div class="float-left" style="position:relative">
<p class="p1 col-lg-6">(91)+8313285202</p><br>
<h5><i class="fa fa-phone-square col-lg-6" style="color:red">EMERGENCY CONTACT</i></h5>
</div>
<br><br>
<div class="float-right" style="position:relative">
<p class="p2 col-lg-6">(91)+MAS@GMAIL.COM</p><br>
<h5><i class="fa fa-check col-lg-6" style="color:green">ONLINE CONSULTANT</i></h5>
</font>
</div>
</div>
</div>
</footer>
</div>
</div>
</body>
</html>
解决方案
这是问题的解决方案:
<footer>
<div class="container-fluid">
<div class="float-left">
<p class="p1 col-lg-6">(91)+8313285202</p>
<br>
<h5><i class="fa fa-phone-square col-lg-6" style="color:red">EMERGENCY CONTACT</i></h5>
</div>
<div class="float-right">
<p class="p2 col-lg-6">(91)+MAS@GMAIL.COM</p>
<br>
<h5><i class="fa fa-check col-lg-6" style="color:green">ONLINE CONSULTANT</i></h5>
</div>
</div>
</footer>
我删除了<div>
with 类row
,也删除了style="position:relative
使用div
andfloat-left
的float-right
。
我还稍微整理了代码。这是我的 Codepen 显示工作代码:https ://codepen.io/CodeBoyCode/pen/gBQVWR
推荐阅读
- jquery - PDF加载后的jQuery事件?
- amazon-web-services - AWS CloudTrail:我可以为跟踪禁用 S3 存储,因为我使用的是 CloudWatch
- java - 在java中查找x和y坐标是否在视图中被两个相交的矩形包围
- python - 从 Django ModelForm 的 Meta 类中动态包含/排除字段
- reactjs - 使用 React 钩子,如何更新对象数组中部分对象的状态
- c - 将多行写回文件,文件长度错误
- python - TensorFlow py_function 嵌套输出类型?
- python - 检查 pandas.core.series.Series 中项目出现的本机方法?
- node.js - 在 Sequelize 查找方法的条件中使用列别名时出错
- python - 不知道服务器 IP 时如何使用 Python SMB 连接?