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

123
Views
How can I resolve my CSS flexbox problem?

I am working on a HTML / CSS / JS project and I'm currently editing a website to add a panel for notifications. Here is how it's supposed to look like.

This is what mine looks like.

How can I align my three items?

Here is my JavaScript code to write the HTML :

function notifElement() {
  const notifUrl = 'https://smart4.io/centralizer';
  const container = document.createElement("div");
  //const aeL = document.createElement("a");

  container.id = "notif";
  const form = document.createElement("form");
  const leftArrow = document.createElement("button");
  leftArrow.name = 'leftButton'
  leftArrow.innerHTML = '&lt'

  const rightArrow = document.createElement("button");
  rightArrow.name = 'rightButton'
  rightArrow.innerHTML = '&gt'
 
  const middleContainer = document.createElement("div");
  middleContainer.id = "middle";
  const middlebutton = document.createElement("button");
  middlebutton.name = 'middleButton'

 
  const text = document.createElement('p')
  t.textContent = 'Lorem Ipsum';
  
  middleContainer.appendChild(t);
 
  form.appendChild(leftArrow);
  form.appendChild(middleContainer);
  form.appendChild(rightArrow);

  container.appendChild(form);
  return container;
 }

And here is my CSS code :

#notif {
  max-width: 720px;
  margin: auto;
  text-align: center;
  position: relative;
  width: 100%;
  height: 12em;
  z-index: 1;
  justify-content: center;
}

#notif > form {
  padding-right: 3em;
}

#notif > form > button {
  border-radius: 50%;
}
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

In CSS add display flex to #notif > form.

#notif > form {
  padding-right: 3em;
  display:flex;
}
about 4 years ago · Juan Pablo Isaza Report

0

Replace justify-content: center; with justify-content: space-around;. Also this property (justify-content) works with display: flex;.

#notify > form {
  display: flex;
  justify-content: space-around;
}
about 4 years ago · Juan Pablo Isaza 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!