Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS The text on the middle of the background cover image doesn't appear.

gummyyyy

New Coder
new to coding, how do I move the text to the center of the picture?

HTML:
<section id="banner" class="d-flex align-items-center">

    <div class="container d-flex flex-column align-items-center" data-aos="zoom-in" data-aos-delay="100">

    </div>

    </section>

<section id="hero" class="d-flex align-items-center">
    <div class="container d-flex flex-column align-items-center" data-aos="zoom-in" data-aos-delay="100">
      <h1>About</h1>
      <img src="assets/img/logo.png" width="320">
      &nbsp;
      <center><h2>The term KAPITBISIG is a Filipino word which means "linked together" or working in unity.</h2></center>
      &nbsp;
      <center><h2>KAPITBISIG</center></h2>
      &nbsp;
      <a href="https://www.youtube.com/channel/" target="_blank"class="btn-about">Check out our YouTube channel</a>
    </div>

<!-- THE STUDENTS -->

  </section><!-- End Hero -->

  <!-- ======= Testimonials Section ======= -->
    <section id="testimonials" class="testimonials">
      <div class="container" data-aos="fade-up">

        <div class="section-title">
          <h2>Meet the team of KAPITBISIG</h2>
        </div>
              <div class="testimonial-item">
                <h3>MG</h3>
                <h4>Creative Director</h4>
                <h3>MA</h3>
                <h4>Creative Editor</h4>
                <h3>NN</h3>
                <h4>Project Coordinator</h4>
              </div>
            </div><!-- End testimonial item -->

      </div>
    </section><!-- End Testimonials Section -->

  </main>

CSS:
#banner{
  width: 100%;
  height: 100vh;
  background: url("../img/taal-church.jpg") top right;
  background-size: cover;
}

#banner .container {
  padding-top: 70px;
  position: relative;

}
 

Attachments

  • 1656926816257.png
    1656926816257.png
    1.1 MB · Views: 3
Last edited:
Something like this -
HTML:
<!DOCTYPE html>
<html>
    <head lang="eng">
        <meta charset="UTF-8">
        <title>Center</title>
        <Style>
            * {
                margin: 0;
                padding: 0;
            }
            #banner{
                width: 100%;
                height: 100vh;
                background: url("immortal.jpg") top right;
                background-size: cover;
            }
            
            h1 {
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                color: #FFF;
            }
        </style>
    </head>
    
    <body>
        <div id="banner"></div>
        <h1>Basic Setup test</h1>
    </body>
</html>
 
Back
Top Bottom