0

I've a HTML code question

Where the H3 is a block element and I've used the H3 tag in css stylish where I've set the display: inline-block; and text-align: center; but why it's not centring.. but when I remove display property it align in middle I thought display element is for block tag where we can't style them in css without doing that ...

20th Oct 2025, 3:26 PM
Axxcii
Axxcii - avatar
3 Respostas
+ 2
show your code
20th Oct 2025, 3:30 PM
Lisa
Lisa - avatar
+ 1
Hey, add a background:red; and see how the element looks. That does the trick when trying to adjust something css related. When the H3 has no display set by you, the element takes the whole width. When you set it to inline block, it has the width of the content.
20th Oct 2025, 5:41 PM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
20th Oct 2025, 7:18 PM
Axxcii
Axxcii - avatar