1
<header>
    <b style="text-align:center;">Header</b>
</header>

The text comes in bolder but it fails to align center

kukkuz
  • 39,721
  • 6
  • 52
  • 88

5 Answers5

1

You'd need to set the text-align:center on the header tag for it to work.

<header style="text-align:center;">
  <b>Header</b>
</header>
Nisarg Shah
  • 13,626
  • 5
  • 36
  • 53
1

Try this:

<header style="text-align:center;">
    <b>Header</b>
</header>

Edit: I guess am the third one to post the exact same answer :D

genesst
  • 1,223
  • 1
  • 10
  • 38
1

<b> is an inline element and it wont support text-align: center. You may either make as a block element by applying display:block or apply text-align: center to the <header> tag

Pons Purushothaman
  • 2,427
  • 1
  • 13
  • 23
0
<header style="text-align:center;">
  <b>Header</b>
</header>

set the center tag in the top of text.

Myco Claro
  • 465
  • 2
  • 14
0

<center><b>Header</b></center>

You can try this without CSS:

Header