html - How do I center an inline-block/floated header with no extra markup? -


I have should a variable width header which is the background color that is wide in the text ( No wider) The only way I can think of doing this (without additional markup) is to set the display inline block or float it to float However the problem is that I can not focus the headers (the other requirement).

The closest I have ever passed is position: relative; By setting , it pulls up to 50% from left to left and then 25% with negative margin, although it does not continually focus the header. This document should remain in the flow so that status: absolute; Nobody else goes.

If you know it's a way to use CSS Any additional markup Please tell me (pseudo-element elements are OK, let me know IE7 There is no problem with support)!

Resolve using the display: table; At the top (with margin: 0 auto;).

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -