使用CSS3显示DIV [英] Display DIV using CSS3

查看:131
本文介绍了使用CSS3显示DIV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,
请看下面的代码

hello friends,
please have a look on below code

<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<div class="mainHolder">
	<div class="loginHolder ">
		<ul>
			<li>Name:</li>
			<li><input type="text" /></li>
			<li>Pwd:</li>
              <li><input type="text" /></li>					 
		</ul>			 
	</div>
	<div class="caption">
		<h5>Login</h5>
	</div>
</div>
</body>



当我将鼠标悬停在div.caption
上时,我无法执行CSS3显示div.loginHolder 我已经尝试过CSS



I''m not able to do CSS3 display div.loginHolder when I hover on div.caption
I have tried following CSS

<style type="text/css">
      .caption:hover + .loginHolder
		   {
			  display:block;
		   }
</style>



知道我哪里出错了

在此先感谢



Any idea where I''m going wrong

Thanks in advance

推荐答案

好吧,该规范说选择器"a + b"的意思是"a",紧随其后的是"b". (此处的规范 [
Well, the specification says that a selector of "a + b" means "a" immediately followed by "b". (Specification here[^])

In your source, your .loginHolder div is before the .caption div, so they are the wrong way around for the selector to work.


这篇关于使用CSS3显示DIV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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