如何让我的图标与我的下拉框水平对齐?

How do I get my icon to horizontally line up with my drop down box?

在将我的图标与下拉框对齐时遇到了一些麻烦。我正在使用 jQuery 手机。我试过使用内联块功能,但我没有运气。

谁能帮我解决一下。谢谢

<head>
<!--jQuery CDN Hosted Files-->
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
    <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
 <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>

<body >
<div style="padding: 20px;">

<img src="https://lh4.googleusercontent.com/-HhNoCFJ803s/AAAAAAAAAAI/AAAAAAAAAAA/ABtNlbAXJpr-jDsvmXVw0tx4PHId84zrlw/mo/photo.jpg?sz=32" class="loginBoxImg">
  <select name="type" id="type">
      <img src="">
      <option value="">Account Type...</option>
      <option value="Teacher">Teacher</option>
      <option value="School">School</option>
  </select><br>
</div>
</body>

您可以使用 flexbox 来实现,首先将 selectimg 包装在一个容器中

<head>
<!--jQuery CDN Hosted Files-->
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
    <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>

<body >
<div style="padding: 20px;" class="container">

<img src="https://lh4.googleusercontent.com/-HhNoCFJ803s/AAAAAAAAAAI/AAAAAAAAAAA/ABtNlbAXJpr-jDsvmXVw0tx4PHId84zrlw/mo/photo.jpg?sz=32" class="loginBoxImg">

  <select name="type" id="type" style="min-width:90%;">
      <option value="">Account Type...</option>
      <option value="Teacher">Teacher</option>
      <option value="School">School</option>
  </select><br>
</div>
</body>

然后给那个容器一个display: flex;

.container{
  display: flex;
  justify-content: space-between;
  align-items: center;
}

最后你需要给 class .ui-select 90% 的宽度

.ui-select{
  width: 90%;
}

Here you have a codepen to test it, and here 关于 flexbox 的信息以及如何使用它,如果有帮助请告诉我!