Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
230 views
in Technique[技术] by (71.8m points)

css - How to arrange these bootstrap elements in an html page

I want to create a web page with html and bootstrap 4 and I'm having trouble arranging my page following this template.

enter image description here

<!doctype html>
<html lang="en">

<head>
  <title>Hepatrote with Bootstrap v4</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</head>

<body>

  <header class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom shadow-sm">
    <p class="h5 my-0 me-md-auto fw-normal">Hepatrote</p>
    <nav class="my-2 my-md-0 me-md-3">
      <a class="p-2 text-dark" href="#">Accueil</a>
      <a class="p-2 text-dark" href="#">Blog</a>
      <a class="p-2 text-dark" href="#">Symptoms</a>
      <a class="p-2 text-dark" href="#">Contacts</a>
    </nav>
  </header>

  <main class="container">
    <div class="pricing-header px-3 py-3 pt-md-5 pb-md-4 mx-auto text-center">

      <!-- How to arrange these elements: left side : Symptoms with text and button 'How to protect yourself ?'
; rgiht side : Image of disease -->

      <!-- How to arrange these elements: Symptoms with text and 4 bootstrap cards With this arrangement-->
      <div class="row row-cols-1 row-cols-md-3 mb-3 text-center">

      </div>
      <footer class="pt-4 my-md-5 pt-md-5 border-top">
      </footer>
  </main>
</body>

</html>
question from:https://stackoverflow.com/questions/65641061/how-to-arrange-these-bootstrap-elements-in-an-html-page

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here is basic stracture of your image using bootstrap 4, this is not responsive so you need to some work for responsive.

Code:

    <html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <title>Hepatrote with Bootstrap v4</title>

    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
 </head>
  <body>
    
<header class="d-flex justify-content-between flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom shadow-sm">
  <p class="h5 my-0 me-md-auto fw-normal">Hepatrote</p>
  <nav class="my-2 my-md-0 me-md-3">
    <a class="p-2 text-dark" href="#">Accueil</a>
    <a class="p-2 text-dark" href="#">Blog</a>
    <a class="p-2 text-dark" href="#">Symptoms</a>
    <a class="p-2 text-dark" href="#">Contacts</a>
  </nav>
</header>

<main class="container">
  <div class="pricing-header px-3 py-3 pt-md-5 pb-md-4 mx-auto">
    <div class="row">
      <div class="col">
        <h1>Symptoms</h1>
        <p>Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs. The passage is attributed to an unknown typesetter in the 15th century who is thought to have scrambled parts of Cicero's De Finibus Bonorum et Malorum for use in a type specimen book.</p>
      </div>
      <div class="col">
      <h1>Image of dieses</h1>
      </div>
    </div> 
    
    <div class="row">
      <div class="col-12">
        <h1 class="text-center">Syptoms</h1>
        <p>Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs.</p>
      </div>
      <div class="row">
        <div class="col-6 ">
            <div class="card">
              <div class="card-body">
                <div class="w-50 d-inline-block" >
                  <h5>Image1</h5>
                </div>
                <div class="w-50 d-inline-block">
                  <h5>Sympt1</h5>
                </div>
              </div>
            </div>
        </div>
        <div class="col-6">
            <div class="card">
              <div class="card-body">
                <div class="w-50 d-inline-block" >
                  <h5>Image1</h5>
                </div>
                <div class="w-50 d-inline-block">
                  <h5>Sympt1</h5>
                </div>
              </div>
            </div>
        </div>
        <div class="col-6">
            <div class="card">
              <div class="card-body">
                <div class="w-50 d-inline-block" >
                  <h5>Image1</h5>
                </div>
                <div class="w-50 d-inline-block">
                  <h5>Sympt1</h5>
                </div>
              </div>
            </div>
        </div>
        <div class="col-6">
            <div class="card">
              <div class="card-body">
                <div class="w-50 d-inline-block" >
                  <h5>Image1</h5>
                </div>
                <div class="w-50 d-inline-block">
                  <h5>Sympt1</h5>
                </div>
              </div>
            </div>
        </div>
      </div>
    </div>
  <footer class="pt-4 my-md-5 pt-md-5 border-top">
  </footer>
</main>
  </body>
</html>

`


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...