Having CSS issue: can't place text right of select box

Why is the word "user" appearing under the select box? I want it to be on the right side of select box. What am I missing?

http://jsfiddle.net/njh85/6/

Answers


You could do this:

HTML:

<div class="ui-widget">
          <select id="users" name="userName">
            <option value="#">
              Select one...
            </option>
            <option value='1'>
              User1
            </option>
            <option value='2'>
              User2
            </option>
            <option value='3'>
              User3
            </option>
            <option value='4'>
              Demo
            </option>
          </select>
</div>
<div id="user">Here is a sample sentence :)</div>

CSS:

/*Users Combobox*/
.ui-combobox {
    position: relative;
    display: inline-block;
    margin-right: 36px;
}
.ui-combobox-toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    margin-left: -1px;
    padding: 0;
    /* adjust styles for IE 6/7 */
    *height: 1.7em;
    *top: 0.1em;
}
.ui-combobox-input {
    margin: 0;
    padding: 0.3em;
}
#user {
 position: relative;
 top: -27px;
 left: 270px;   
}

FIDDLE:

http://jsfiddle.net/FlameTrap/njh85/10/

All you have to do is move the text left and up from where it normally is which is possible by using: position: relative. Also the text is outside the <div>.


Move it inside the div right after your select box and add some right margin to your .ui-combobox

http://jsfiddle.net/njh85/9/


Need Your Help

Websphere server/hibernate memory leak?

hibernate memory-management jdbc websphere

I am running Websphere 7.0 form RAD. When I run it without a JDBC datasource defined for Hibernate to read from, it seems to work fine. But if I add the datasource, it starts using more and more me...

refresh and save excel file via c#

c# excel

I use this code to open refresh save and close excel file: