2011-10-12 57 views
0
<html> 
<head> 
<title></title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 

</head> 
<body> 

<div > 
    <select> 
     <option>[select]</option> 
    </select> 
</div> 


<div> 
    <img rc="dropDownArrow.png"/> 
</div> 

</body> 
</html> 

上面的代码运行后,img元素变为下拉列表下方(抱歉,我不能发布图片,因为我刚刚注册成为新用户离开1分钟前到illstrate),需要在选择元素之后放置一个img元素,怎么样?

但什么我想实现的是:img元素必须在下拉列表

我试图修改以各种不同的方式CSS的右侧,但它不工作,

任何人都可以提出什么我应该做??

回答

1

试试这个:

<div style="width:100px; overflow:hidden; border-right:1px; float:left;"> 
    <select> 
     <option>[select]</option> 
    </select> 
</div> 


<div style="float:left"> 
    <img rc="dropDownArrow.png"/> 
</div> 
0

使用任何CSS的float属性:

<div style="width:100px; overflow:hidden; border-right:1px"> 
    <select style="float:left"> 
     <option>[select]</option> 
    </select> 
    <img style="float:left" src="dropDownArrow.png"/> 
</div> 
<div style="clear:both;"></div> 

或表:

<table> 
    <tr> 
     <td> 
      <select> 
       <option>[select]</option> 
      </select> 
     </td> 
     <td> 
      <img style="float:right" src="dropDownArrow.png"/> 
     </td> 
    </tr> 
</table> 
0

您需要使用float属性:

<div style="width:100px; overflow:hidden; border-right:1px; float:left;"> 
    <select> 
     <option>[select]</option> 
    </select> 
</div> 


<div> 
    <img rc="dropDownArrow.png" style="float: right;"/> 
</div> 
0

您的代码应更改为:

<div style="width:100px; overflow:hidden; border-right:1px;float:left"> 
    <select> 
     <option>[select]</option> 
    </select> 
</div> 

<div style="float: left"> 
    <img rc="dropDownArrow.png"/> 
</div>