Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I make the header just display in one line?

I need to make the name etc. displaying in one line. I tried out display: inline; on the "header" but it didn’t work. (im newbie)

body {
  background-color: snow;
  box-sizing: border-box;
}

header {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: 1.611rem;
}

header .circle {
  display: inline-block;
  height: 1.79rem;
  width: 1.79rem;
  border-radius: 50%;
}

header .circle__red {
  background: #ff605C;
}

header .circle__yellow {
  background: #FFBD44;
}

header .circle__green {
  background: #00CA4E;
}
<body>
  <header>
    <div class="circle circle__red"></div>
    <div class="circle circle__yellow"></div>
    <div class="circle circle__green"></div>

    <div class="name">
      <h3 class="name-alt">Muhammed Ali Yuruk</h3>
    </div>
  </header>
</body>

Code:
https://codepen.io/saruhankaya_/pen/rNpGMxK

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You want display: inline; or display: inline-block; on the children of header not header. The selectors header>* or .circle, .name should work.

body {
  background-color: snow;
  box-sizing: border-box;
}

header {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: 1.611rem;
}

header .circle {
  display: inline-block;
  height: 1.79rem;
  width: 1.79rem;
  border-radius: 50%;
}

header .circle__red {
  background: #ff605C;
}

header .circle__yellow {
  background: #FFBD44;
}

header .circle__green {
  background: #00CA4E;
}

header>* {
  display: inline-block;
}
<header>
  <div class="circle circle__red"></div>
  <div class="circle circle__yellow"></div>
  <div class="circle circle__green"></div>

  <div class="name">
    <h3 class="name-alt">Muhammed Ali Yuruk</h3>
  </div>
</header>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading