Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

collapsing width of block elements.

Status
Not open for further replies.

travisbrown

Technical User
Dec 31, 2001
1,016
What's the best cross-browser way to get block elements to collapse width while retaining their block attribute?

For example, <p class="msg">This is some content</p>

If I was to put a border around this, can I get it to collapse to the width of the content, then centre using margin: 0px auto?

Do I have to use a combination of display: table and display: inline-block?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top