Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visibility: hidden;opacity: 0; 的区别 #8

Open
MangiDu opened this issue Nov 9, 2017 · 0 comments
Open

visibility: hidden;opacity: 0; 的区别 #8

MangiDu opened this issue Nov 9, 2017 · 0 comments
Labels

Comments

@MangiDu
Copy link
Owner

MangiDu commented Nov 9, 2017

先扔规范:

visibility

hidden
The generated box is invisible (fully transparent, nothing is drawn), but still affects layout. Furthermore, descendants of the element will be visible if they have 'visibility: visible'.

visibility 是用于规定被 html 元素生成的‘盒(box)’是否被渲染的。其值设置为 hidden 后,元素形成的盒仍会影响到布局但是该元素不可见,或者说没有被绘制

这样就可以理解为什么鼠标点击相应区域不会触发事件了,因为点击没有实际地落在该元素上。

另一种使用 click() 的方法仍可以正常触发点击。

opacity

opacity 是css3增加的有关元素透明度的属性,它只决定以什么程度去混合这种渲染模式,而不会决定元素是否被渲染是否影响布局。

@MangiDu MangiDu added the CSS label Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant