I
Ivan Shmakov
Is there an easy way to arrange a known number of
display: inline so that the last has its "natural" width, while
the rest of the window's width is distributed equally among the
other elements? Like:
[element 1] [elt 2] [element 3] ["natural" width for the last one]
Also, how do I ensure certain spacing between the elements? The
only way I could think of is something like (for 1em spacing):
..elt-first {
margin-left: 0;
margin-right: .5em;
}
..elt-middle {
margin-left: .5em;
margin-right: .5em;
}
..elt-last {
margin-left: .5em;
margin-right: 0;
}
However, it's mildly inconvenient, as it requires all the
elements to be explicitly tagged as "first", "middle", and
"last." Or should I be using some kind of a "spacer" element
in-between the "payload" ones?
..spacer { width: 1em; }
TIA.
display: inline so that the last has its "natural" width, while
the rest of the window's width is distributed equally among the
other elements? Like:
[element 1] [elt 2] [element 3] ["natural" width for the last one]
Also, how do I ensure certain spacing between the elements? The
only way I could think of is something like (for 1em spacing):
..elt-first {
margin-left: 0;
margin-right: .5em;
}
..elt-middle {
margin-left: .5em;
margin-right: .5em;
}
..elt-last {
margin-left: .5em;
margin-right: 0;
}
However, it's mildly inconvenient, as it requires all the
elements to be explicitly tagged as "first", "middle", and
"last." Or should I be using some kind of a "spacer" element
in-between the "payload" ones?
..spacer { width: 1em; }
TIA.