Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML - Placing Headers Side By Side

Tags:

html

css

I couldn't seem to put both of the headers next to each other in the same line. And also, I would like to align the headers to the center of the page.

Need help on this please.

.inline-div {
  display: inline;
}

h4
{
  text-align: center;
}
<div class="inline-div">
  <h4>Product Tested :</h4>
  <h4>Profile Tested :</h4>
</div>
like image 611
cerberus99 Avatar asked Jul 25 '26 09:07

cerberus99


2 Answers

.inline-div {
  display: block;
  text-align: center;
}

h4
{
  display: inline-block;
  text-align: center;
}
<div class="inline-div">
  <h4>Product Tested :</h4>
  <h4>Profile Tested :</h4>
</div>
like image 192
kyun Avatar answered Jul 27 '26 00:07

kyun


.inline-div {
  display: inline;
  
}

h4
{
  text-align: center;
  display: inline-block;
}
<div class="inline-div">
  <h4>Product Tested :</h4>
  <h4>Profile Tested :</h4>
</div>

add display: inline-block; to h4

.inline-div {
  display: inline;
}

h4
{
  text-align: center;
  display: inline-block;
}

<div class="inline-div">
  <h4>Product Tested :</h4>
  <h4>Profile Tested :</h4>
</div>

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!