html - Html 引导布局
问题描述
我正在做一个个人项目,我试图实现与所附图像相同的外观。我正在使用 HTML 和引导程序来实现外观,但我被卡住了。谁能帮助我,我正在学习如何制作网站,我无法正确对齐身体并在知识左侧插入垂直线是电源部分。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css"
integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous" />
<title>Document</title>
</head>
<body style=" padding: 15px 10px 15px 10px; ">
<!-- main body section -->
<div style="border: 2.5px solid rgb(197, 195, 195);"">
<div class=" container-fluid">
<div class="d-flex justify-content-start" style="border-bottom: 2.5px solid rgb(197, 195, 195);">
<img style=" width: 8%; height: 25%; padding: 10px 5px 20px 20px;" src="download.jpg" alt="">
<h1 style="font-size: 1rem; text-align: center;"><strong
style="font-size: 3.8rem;">KATA</strong><br>material art club</h1>
<div class="d-flex justify-content-end" style="padding-left: 60rem;">
<span style="text-align: center; padding-top: 20px; ">
<i class="fas fa-user-circle"></i>
<a href="#">JoinClub! <br>login</a>
</span>
</div>
</div>
<div class="d-flex justify-content-start" style="border-bottom: 2.5px solid rgb(197, 195, 195) ; ">
<ul style="text-align: left; padding-left: 0px!important; padding-top: 10px;">
<a href="#" style="padding: 10px 30px 5px 30px;">Home</a>|
<a href="index.html" style="padding: 10px 30px 5px 30px;">Porfolio</a>|
<a href="about.html" style="padding: 10px 30px 5px 30px;">About Us<a>|
<a href="contact.html" style="padding: 10px 30px 5px 30px;">Contact Us</a>|
</ul>
</div>
<div class="d-flex justify-content-start" style="border-bottom: 2.5px solid rgb(197, 195, 195) ; ">
<h1 style="padding-left: 20px;">Portfolio</h1>
<form style=" float: right; padding-left: 850px ; padding-top: 15px;" id="tfnewsearch" method="get"
action="http://www.google.com">
<input style="border-radius: 25px;" placeholder=" Search" type="text" class="tftextinput" name="q"
size="21" maxlength="120">
</form>
</div>
</div>
<!-- main body -->
<div class="container">
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6 d-flex" style="padding-left: 80px; padding-top: 100px;">
<div style="border: 3px solid rgb(197, 195, 195); border-radius: 5px;">
<img style="border-radius: 5px; padding: 10px 10px 30px 10px ;" src="download.jpg" alt="">
</div>
<div style="border: 3px solid rgb(197, 195, 195); border-radius: 5px; margin-left: 20px; ">
<img style="border-radius: 5px; padding: 10px 10px 30px 10px ;" src="download.jpg" alt="">
</div>
</div>
<div class="col-xs-7 col-sm-6 col-md-6 d-flex justify-content-end ">
<div style="border-left: 2.5px solid rgb(197, 195, 195) ; ">
<br>
<a style=" padding-left: 10px; font-size: 1.2rem; " href="#">Knowledge is power!</a>
<br>
<br>
<ul>
<a href="#">Online Self-defence Lessons</a>
<p style="font-size: 10px;">shor distribution of newest lessons</p>
<a href="#">Self-efence modern life hacks</a>
<p style="font-size: 10px;">shor distribution of newest hacks</p>
<a href="#">Awesom places to visit</a>
<p style="font-size: 10px;">shor distribution of newest places</p>
<a href="#">Self-defence celebrities</a>
<p style="font-size: 10px;">shor distribution of the newest news about celebritie</p>
</ul>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-6 d-flex" style=" padding-left: 80px; padding-top: 100px; ">
<div style="border: 3px solid rgb(197, 195, 195); border-radius: 5px;">
<img style="border-radius: 5px; padding: 10px 10px 30px 10px ;" src="download.jpg" alt="">
</div>
<div style="border: 3px solid rgb(197, 195, 195); border-radius: 5px; margin-left: 20px;">
<img style="border-radius: 5px; padding: 10px 10px 30px 10px ;" src="download.jpg" alt="">
</div>
</div>
</div>
</div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
<style>
.float-container {}
.float-child {
width: 50%;
float: left;
padding: 0px;
}
.container-fluid {
padding-left: 0px !important;
padding-right: 0px;
}
</style>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"></script>
</body>
</html>
<style>
.float-container {}
.float-child {
width: 50%;
float: left;
padding: 0px;
}
.container-fluid{
padding-left: 0px!important;
padding-right: 0px;
}
</style>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"></script>
</body>
</html>
解决方案
这是我的建议
- 尝试将所有内联 css 移动到外部 css
- 使用引导程序中的网格系统
这里是链接https://getbootstrap.com/docs/4.5/layout/grid/
推荐阅读
- node.js - 您可以从非 websocket lambda 向 websocket 客户端发送消息吗?
- python-3.x - 如何为删除 EBS 快照的 AWS Lamba 函数实施指数退避
- r - 根据 R 中的开始/结束时间绘制发生频率
- vue.js - 如何将一个响应拆分为多个 Vuex 模块?
- types - 如何统一采用 f64 和 Complex 的函数
? - ansible - 将已安装的 Homebrew 包收集为 MacOS 的 Ansible“事实”
- javascript - 如何复制而不丢失选择javascript?
- flutter - 如何制作一个 IconPicker,一个列出图标供用户选择的小部件
- aws-lambda - AWS Lambda 节流——为什么如此沮丧?
- django - 将许多上传的文件保存到 db save() 方法时,仅对查询中的最后一个文件有效