Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
Center div with id of a title

I have a title and a div horizontally, what I am trying to do is to center the div with the corresponding title.

enter image description here

As can be seen in the image, it cannot be centered properly.

This is my code:

<h1 id='<?= str_replace(" ", "", $data->title); ?>'><?= $data->title; ?></h1>
<?= $data->text; ?>

<div class="flexbox">
  <div class="contenido-flex">
    <blockquote>
      <p><?= $data->title; ?></p>
    </blockquote>
    <pre class="is-paddingless" id="a<?= esc($data->id); ?>"><code class="<?= strtolower($data->tip); ?>">
          <?php if ($data->fdc== "JSON") : ?>
          <?= json_decode($data->cod); ?>
          <?php else : ?>
             <?= $data->cod; ?>
          <?php endif; ?>  
          </code></pre>
  </div>
</div>




.flexbox {
    /*  */
    height: 100vh;
}

.contenido-flex {
    margin-top: -700px;
}
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You could use align-items: center; Here is an example:

.flexbox {
  background: red;
  height: 100vh;
  display: flex;
  align-items: center;
  align-content: center;
}

.contenido-flex {
  background: green;
}
<h1 id='123'>MyTitle</h1>

<div class="flexbox">
  <div class="contenido-flex">
    <blockquote>
      <p>Title</p>
    </blockquote>
    <pre class="is-paddingless" id="a-11>"><code class="123">
         Some Data
          </code></pre>
  </div>
</div>

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!