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?
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?