|
Posted by MangroveRoot on 11/01/07 23:01
I've looked for tutorials on how to do this for some years,
with no success.
Most of the time, I'm a good boy and only use <TABLE> (etc)
to format tabular data.
However, there remains one thing that <TABLE> does excellently
that I have yet to find a way to do using solely CSS:
Put a block of text *in a box*,
which box sizes itself to the size of the *content*,
not to some arbitrary fixed width or some percentage of the window.
E.g., the equivalent of:
<table border="5" frame="inset">
<tr><td bgcolor="red">
content
</td></tr>
</table>
I've tried things like:
<div style=" align:center;
border-width:5;
border-style:inset;
background-color:red;
">
content
</div>
but this (a) creates a box that takes up the entire width of the window,
leaving the content looking a little bit orphaned in the middle;
and (b) doesn't produce the same coloration of the border
(specifically, it produces black and grey,
instead of light-page-background and dark-page-background).
Surely CSS can do this; how?
[Back to original message]
|