This is the page I have created :

I want to reduce the width of the block which has the orange color as a background-color, without using a number in the property width, is there any other method to do that ?
I tried float:left; and it worked but it goes to the left I want the width to be detected automaticly due to the text lenght and in the center of the html page.
Well if you want it to be centered, with an auto width, one option would be to treat it as an
inlineelement.or:
Assuming the parent element has
text-align: center, this should be sufficient.