I have a page where I need a piece of text to appear aligned to the upper left of an absolutely positioned element (a span, if it matters), and a button to appear aligned to the upper right of the same element. edit: Problem with this is even when I use float: right;
and display: inline;
the button still likes to drop the next line.
Currently my solution is to wrap the button with a span element, float the span to the right, and then set the button to absolute position. Problem with this is it doesn't appear unless I manually specify the width of the wrapper span to fit whatever size the browser renders the button. Which is kinda dumb.
What's the proper way to do this?
edit 2: Here was my original code:
#header
{
position: absolute;
top: 0;
bottom: auto;
left: 0;
width: 100%;
height: 24px;
overflow: hidden;
}
/* Header's buttons. */
#header > span
{
float: right;
width: 100px;
}
#header > span > button
{
position: absolute;
}
And the HTML:
<span id="header">
Trigger editor
<span><button type="button" id="h_output">Output Triggers</button></span>
</span>