如何在悬停时显示隐形文字输入框? [英] how do i make an invisible text input box visible on hover?

查看:383
本文介绍了如何在悬停时显示隐形文字输入框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎不适合我!

HTML

 < div id =box1> 
< form action =>
< input type =stringname =htmlcode/>
< / form>
< / div>

CSS

 #box1 {
width:100px;
height:100px;
border-color:black 4px
}
input {
display:none;
}
a:悬停输入{
display:block;
}

文本输入不可见或可见,但不响应悬停

解决方案

您没有 a 标签可以悬停显示输入...



将其更改为#box1:hover input {display:block;} 将您的鼠标移动到框中时显示。



border-color:black 4px 也是无效的。如果你想设置边框颜色,你只能给它一个颜色,而不是颜色和大小。



这是一个 demo 显示了这两项修正。


It doesn't seem to work for me!

HTML

 <div id="box1">
     <form action="">
         <input type="string" name="htmlcode" />
     </form>
 </div>

CSS

#box1 {
    width:100px;
    height:100px;
    border-color:black 4px
}
input {
    display:none;
}
a:hover input{
    display:block;
}

the text input is either invisible, or visible but does not respond to hover

解决方案

You don't have an a tag that you can hover to show the input...

Change it to #box1:hover input{display:block;} so it will show when you move your mouse into the box.

border-color:black 4px is also invalid. If you want to set the border color, you can only give it a color, not a color and size.

Here's a demo showing both of those things fixed.

这篇关于如何在悬停时显示隐形文字输入框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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