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

Is this the correct method to pass an array to a function?

c++

This is the working program to pass an array in a function, but I am not able to understand that in the print function only the base address of the array is passed but still I am able to access the...

What's the range of file descriptors on 64-bit Linux?

c linux

I'm writing a program using epoll_wait to wait for file descriptors on 64-bit Linux, and I try to put some information together with the file descriptor in the epoll_event user data.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.