显示两个互相选择,两个都有向右浮动

时间:2013-11-28 15:11:16

标签: html css

http://jsfiddle.net/92BQK/

我做错了什么?

我负责一个单独的P,因为我知道devResp将是容器的整个宽度,而devImage肯定不会

<p>Responsible: </p>
 <p>
   <select id="devResp" style="float:right">
     <option>ULTIEMETESTHOEREN</option>
   </select>
 </p>
 <p>
  Image:
   <select id ="devImage" style ="float:right">
     <option></option>
   </select>
 </p>

2 个答案:

答案 0 :(得分:2)

您需要在第二个clear: right的样式中加入select

请参阅小提琴:http://jsfiddle.net/92BQK/2/

<强>代码:

<p>Responsible: </p> 
<p>
    <select id="devResp" style="float:right">
        <option>ULTIEMETESTHOEREN</option>
    </select>
</p>
<p>Image:
    <select id ="devImage" style ="float:right; clear: right;">
        <option></option>
    </select>    
</p>

答案 1 :(得分:1)

检查这是否是您想要的:http://jsfiddle.net/logintomyk/92BQK/14/

<p  style="float:right" >
        Responsible: 
            <select id="devResp">    
                <option>ULTIEMETESTHOEREN</option>
            </select>
</p>

<div style="clear:right"></div>

<p style ="float:right">
    Image:
           <select id ="devImage" >
             <option></option>
           </select>
</p>