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

The text comes in bolder but it fails to align center

kukkuz
  • 41,512
  • 6
  • 59
  • 95

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
  • 14,151
  • 6
  • 34
  • 55
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,333
  • 1
  • 10
  • 39
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,225
  • 1
  • 14
  • 23
0
<header style="text-align:center;">
  <b>Header</b>
</header>

set the center tag in the top of text.

Myco Claro
  • 475
  • 2
  • 14
0

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

You can try this without CSS:

Header