是的,它需要你重新排列,其中input
是,但it can be done。
HTML
<div class="box">
<input/>
<div class="overlay"></div>
LOREM IPSUM LOREM IPSUM <br/>
LOREM IPSUM LOREM IPSUM LOREM IPSUM
</div>
CSS
.box{
background : red;
padding: 20px;
position: relative;
width: 200px;
}
.overlay{
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
background: rgba(0,0,0,0.6);
visibility: hidden;
opacity: 0;
z-index: 1;
}
.box input {
position: absolute;
visibility: hidden;
opacity: 0;
width: 50%;
top: 0;
left: 50%;
margin-left: -25%;
z-index: 2;
}
.box:hover .overlay,
.box:hover input,
.box input:focus,
.box input:focus + .overlay
{
visibility: visible;
opacity: 1;
}
是我的願望,所以解決方案是在外面思考。 :) – 2012-04-06 14:04:32
@ RicardoRodrigues - 哦,好了!如果我可以給你+10代表這個評論,我會:-)。 – ScottS 2012-04-06 14:11:23
只是想知道你能做一個表嗎?而是做一個有很多輸入的div。當一個選擇它保持形式? http://jsfiddle.net/vzRqY/9/ - >你可以爲這種情況嗎? – 2012-04-06 14:42:16