0

I am trying to build a logout button into my website, it should be on the left side in the containing <div>. I am trying to build it in an upper <div> that contains some text, that should not be moved away from the middle. So how do I solve this problem (is there maybe a way without using position: absolute

.text-center {
  text-align: center;
}
<div class="text-center">
  <button>Logout</button>
  Title
 </div>
Cyberguy Game
  • 355
  • 1
  • 8

1 Answers1

0

Do you mean something like this?

.appBar {
  background-color: teal;
  display: flex;
  justify-content: 'space-around';
  align-items: 'center';
  height: 2.5rem;
}

.titleSection, .actionSection {
   display: flex;
   align-items: center;
   justify-content: center;
}

.titleSection {
  flex-grow:1;
}
<div class="appBar">
  <div class="titleSection">
    Title
  </div>
  <div class="actionSection">
    <button>Logout</button>
  </div>
</div>
Vahid Alimohamadi
  • 4,900
  • 2
  • 22
  • 37