开发者

need to place a img element right after a select element, how?

<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>

after runs above code, the img element goes beneath the drop dow开发者_运维技巧n list (sorry i can't post a picture to illstrate as i just registered as a new user here 5 minutes ago),

BUT what I want to achieve is: the img element must be on the right side of the drop down list

I have tried to modify the css in various different way, but it does not work,

can anyone suggest what i should do??


Try this:

<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>


Use either the css float property:

<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>

Or a table:

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


You need to use the float property:

<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>


Your code should be changed to:

<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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜