CSS下拉文本框 [英] CSS dropdown textboxes
本文介绍了CSS下拉文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
如何制作下拉菜单div,其中有文本框(两个).我希望它可见,单击一个按钮(上面带有箭头的按钮).
CSS的用途是什么?
Hello,
How can I make dropdown div, which has text boxes in it (two). I want it to be visible a button is clicked (a button with an arrow on it).
Whats the CSS for that?
推荐答案
这很简单.取一个div并将其display属性设置为none,然后编写一个javascript函数,将div的display属性设置为block,然后单击按钮时调用javascript函数.
It''s very simple. Take a div and set it''s display property to none, then write a javascript function which will set the display property of div to block, then call the javascript function on button click.
<div id="dropdown" style="display:none">
<input type="text" width="100" height="30" />
</div>
Javascript函数:-
Javascript function:-
function ShowDiv()
{
document.getElementById("dropdown").style.display="block";
}
现在,在单击按钮时调用此JavaScript函数.
就这样!
祝你好运.
Now call this JavaScript function on button click.
that''s it!
Good luck.
这篇关于CSS下拉文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文