首页 > 解决方案 > 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>

标签: htmltwitter-bootstrapbootstrap-4

解决方案


这是我的建议

  1. 尝试将所有内联 css 移动到外部 css
  2. 使用引导程序中的网格系统
    这里是链接https://getbootstrap.com/docs/4.5/layout/grid/

推荐阅读