I am running into a with issue with block elements.
I would like my divs to expand their width to their content, like inline elements.
It seems that right now I can only deal with 100% width, or set a fixed absolute width on block elements.
The only other stipulation is that i need to use margin/padding on them as well, which knocks out using inline.
There has got to be a better simpler way to do this.
Things I have tried:
1) Make my divs inline or use spans:
Doesn't work as then it begins ignoring margin/padding.
2) Wrap my divs in a table:
This gives me the effect I want but I feel all dirty doing it.
Won't Work
<div style="border: solid 1px red; padding: 14px; display: inline;">
DIV
</div>
Solution :queasy:
<table cellspacing="0" cellpadding="0"><tr>
<td><div style="border: solid 1px red; padding: 14px;">
TABLE/TR/TD/DIV
</div></td>
</tr></table>