{"id":811,"date":"2012-06-30T14:16:58","date_gmt":"2012-07-01T00:16:58","guid":{"rendered":"http:\/\/mymonkeydo.com\/?p=811"},"modified":"2012-06-30T14:16:58","modified_gmt":"2012-07-01T00:16:58","slug":"css-width-not-working","status":"publish","type":"post","link":"https:\/\/mymonkeydo.com\/css-width-not-working\/","title":{"rendered":"CSS Width not working"},"content":{"rendered":"
I am replacing a two-column table where the first column is on the left with a width about 90% and the 2nd column is on the right with a width of 10%. \u00a0The following HTML does not work as the span width only is as wide as the text. \u00a0When I use floats on the spans, it takes the span elements out of the layout so that the li collapses as if there’s nothing in it.<\/p>\n
<ul>
\n<li><span>left<\/span><span>right<\/span><\/li>
\n<\/ul><\/p>\n
Turns out I need to set the display attribute to inline-block for the span elements. \u00a0Now the width works as expected.<\/p>\n
<\/p>\n