how to justify content to the end

Viewed 110

I have one background image in a container class. I divided as col -6. first col-6 is empty.However, I want to put content on the right side of the col-6. I tried to do it by adding justify-content-end class but it did not work. It appears as below. what I did. However I want to display it like below what I expected

<div class="main-contact">
            <div class="container">
                <div class="col-6">
                </div>
                <div class="col-lg-6 col-12 justify-content-end">
                    <div class="main-about-content">
                        <h3>Hayal Ettiğiniz Mobilya ile </h3><br>
                            <span>
                                Bahçenizi Tamamlayalım.
                            </span>
                        <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque
                            laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi
                            architecto beatae vitae dicta sunt explicabo.</p>
                        <a href="iletisim.html">Detaylı Bilgi</a>

                    </div>
                </div>
            </div>
        </div>

.main-contact {
background-image: url(../img/Asset6.png);
background-size: cover;
background-repeat: no-repeat;
   }


.main-about-content {
        background-color: rgb(255,255,255, 0.3);
       color: white;
       padding: 65px 40px;
       text-shadow: 0 0 10px black;
     }
4 Answers

Just add an offset

.main-contact {
  background-image: url(https://images.theconversation.com/files/393210/original/file-20210401-13-z6rl6z.jpg?ixlib=rb-1.1.0&rect=9%2C0%2C2994%2C1999&q=45&auto=format&w=496&fit=clip);
  background-size: cover;
  background-repeat: no-repeat;
}

.main-about-content {
  background-color: rgb(255, 255, 255, 0.3);
  color: white;
  padding: 65px 40px;
  text-shadow: 0 0 10px black;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
<div class="main-contact">
  <div class="container">
    <div class="col-6">
    </div>
    <div class="offset-sm-6 col-sm-6 justify-content-end">
      <div class="main-about-content">
        <h3>Hayal Ettiğiniz Mobilya ile </h3><br>
        <span>
          Bahçenizi Tamamlayalım.
        </span>
        <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>
        <a href="iletisim.html">Detaylı Bilgi</a>

      </div>
    </div>
  </div>
</div>

I used offset-sm-6 col-sm-6 to make the result visible in the snippet, but feel free to use offset-lg-6 col-lg-6 for your project if you want it only on large screens.

you can 2 ways for justify-content to the end

first Type use CSS text-align:right; and Second Type use display:flex; justify-content:end;

div{display:flex; justify-content:end;}

<div> hello </div>

I think there should be a row

<div class="row">
   <div class="d-flex justify-content-end">
      <div class="col-12">
        -------
      </div>
   </div>
</div>
Related