1

I need to put the image in the center of the screen with the caption, but I'm not getting it

 <div id="team-area">
    <div class="container">
      <div class="row">
        <div class="col-12">
          <h3 class="main-title">Nosso time</h3>
          <div class="container-fluid"></div>
            <image
            src="img/profile.jpg"
              class="img-thumbnail img-fluid m-x-auto d-block" width="350px">
              <div class="caption text-md-center"><em>Software Developer</em></div>
          </div>
        </div>
      </div>
    </div>
  </div>

enter image description here

abney317
  • 7,760
  • 6
  • 32
  • 56

3 Answers3

0

Probably you made a mistake in image tag class. change m-x-auto to mx-auto.

<!DOCTYPE html>
<html>
<head>
  <title>Bootstrap Example</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.0/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.0/js/bootstrap.min.js"></script>
</head>
<body>
<div id="team-area">
    <div class="container">
      <div class="row">
        <div class="col-12">
          <h3 class="main-title">Nosso time</h3>
          <div class="container-fluid text-center">
            <image src="https://unsplash.it/200/200" class="img-thumbnail img-fluid mx-auto" width="350">
            <div class="caption text-md-center"><em>Software Developer</em></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
</html>
Sheri
  • 1,383
  • 3
  • 10
  • 26
0

You can remove the d-block from the image and add text-center to the containter-fluid. Please see below example.

<div class="container-fluid text-center">
    <image src="img/profile.jpg" class="img-thumbnail img-fluid m-x-auto" width="350px">
    <div class="caption text-md-center"><em>Software Developer</em></div>
</div>
Samvel Petrosov
  • 7,580
  • 2
  • 22
  • 46
0

Probably you made a mistake in the image tag class. change m-x-auto to mx-auto

or your css should be like for image parent tag/div

div img{
margin: 0 auto;
}
MD. Sani Mia
  • 272
  • 1
  • 7