如何在文本框的右侧显示图像,而不是左侧 [英] how to show image in right side of text box instead of left side

查看:498
本文介绍了如何在文本框的右侧显示图像,而不是左侧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个asp文本框,我想把图像放在里面,通过下面的样式表我能把图像放在文本框内,但它放在左边。

I having a asp text box and i want to put image inside it, by below style sheet I able to put image inside textbox, but it put in left side.

问题:如何在右侧显示图片?

Question : how to show the image in right side?

.watermark
 {
 background-image: url('/Images/bt_dropdown.png') ;
 background-repeat: no-repeat;

 vertical-align: middle;
 background-color: white;
}

<asp:TextBox ID="txtCombo" runat="server" ReadOnly="true" Width="200" Font-Size="X-Small" CssClass="watermark"></asp:TextBox>

推荐答案

在CSS中:

background-position:right;

这看起来像一个可用性问题。如果你要让教科书看起来像一个下拉/组合框,用户会希望它的行为像一个组合框(喜欢,能够点击箭头和选择一些东西)。你要实现某种JavaScript或可点击的功能吗?如果它将是一个标准的文本框,我建议避免与其他控制/输入类型的任何混淆。

This looks like a usability problem though. If you're going to make a textbook look like a dropdown/combobox, users are going to expect it to behave like a combobox (like, being able to click the arrow and choose something). Are you going to be implementing some kind of JavaScript or clickable feature? If it's going to be a standard textbox I recommend avoiding any confusion with other control/input types.

这篇关于如何在文本框的右侧显示图像,而不是左侧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆