Jukka K. Korpela wrote:
Quote:
Scripsit Mike Harrison:
>
Quote:
>Hi, I have some simple HTML like this:
>
Please post a URL, not a snippet of code.
One doesn't need a URL of a fully formed page to ask how to do
something. His illustrative snippet is short and clear. I'm awarding you
one cluelessness point of your own.
Quote:
Quote:
><div id="container" style="width:100%;">
><input type="text" <input type="button" style="float:right;"
>value="Click here...">
></div>
>
"Click here..." is clueless. Just an example, maybe, but it's a _bad_
example, and people actually use such button texts, which are
(literally) clueless, i.e. give no clue of the meaning and effect of the
button.
Another cluelessness point for Jukka, who doesn't understand it's
perfectly OK for an example to be generic and stripped-down, and that
all that's required of it is that it be sufficiently illustrative for
the question being asked.
Quote:
A text input field without a label is clueless, too.
A third cluelessness point for Jukka, to whom it doesn't occur that the
OP almost certainly intends to have a label in the real page but just
didn't bother included it in the example, where it wasn't necessary for
the purposes of his question.
Quote:
It is not obvious at all how the text field and the button relate to
each other. If they do, why not use <fieldsetwith a descriptive
<legend>? Then you have a _different_ styling problem, and perhaps one
that is worth addressing.
It's an example. The clarity of their working relationship in the final
product is extraneous here and in fact might even detract from the
example's ability to illustrate the OP's question. A fourth cluelessness
point for Jukka.
Quote:
Besides, such a button is normally quite pointless, since <input
type="button"only works (if it works at all) via scripting, and there
isn't any scripting in your snippet.
Cluelessness point number five. Jukka still hasn't figured out that the
example isn't intended to be the whole page.
Quote:
So how about starting a from a good and real example, presented by
providing the URL?
Probably because there isn't anything else on the page that would have
anything to do with getting an answer to the OP's technical question.
Quote:
Quote:
>I want the button to remain the normal size and be right-aligned, and
>the edit box to automatically take up the remaining width of the
>container.
>
Really? Even if the canvas is ten meters wide?
If 1em = 20cm on that particular canvas, why not? Cluelessness point
number six.
Quote:
What happens when CSS is off? The width will be then set by browser
defaults, which are rather small (typically, about 20 characters). So
maybe you should first choose a suitable size="..." value; it's
inconvenient guesswork, but it's better to make an intelligent guess
that to let browsers default.
Wow, one helpfulness point.
Quote:
>
Quote:
>I suspect I'm missing something obvious,
>
We obviously miss the URL.
>
Quote:
>but how can I do this with CSS?
>
We miss the definition of what "this" consists of.
Attention deficit disorder acting up? Even if you lose track of
pronominal antecedents that easily, you can always go back and reread.
Quote:
To begin with, when the button element appears after the text input
element, it will appear below it, though right-aligned. If you want them
to appear on the same line visually, you need to put the button element
before the text input element.
>
You haven't actually made _any_ attempt to set the text input field
width, in HTML or in CSS, in your snipped. The 100% width is set for the
container element, for which it has no effect, since the default
rendering is to make a <divelement as wide as possible.
>
There does not seem to be any direct CSS way of achieving what you want
(except using table-related properties that are not supported by IE),
but it's trivial in HTML, with one simple piece of CSS:
Two more helpfulness points, bringing the total to three.
Quote:
<table width="100%">
<tr><td width="100%"><input type="text" style="width:100%"></td>
<td><input type="button" value="Click here..."></td></tr>
</table>
How dare you provide an example without building it into a fully
functional, cluelessness-free page with a URL! What a hypocrite. For
this I'm awarding two more cluelessness points.
Quote:
>
However, what would be the point? If the field needs as much space as
possible, why waste space by putting a button on its right? And why not
make it a textarea if it may need a lot of space?
>
One more helpfulness point. Final tally: 8 cluelessness points, 4
helpfulness points. Final cluelessness/helpfulness (CH) quotient for the
posting: 200%.