css - opacity 属性有一些问题

标签 css

我希望我的 HTML 背景不透明度为 .9,但由于某些原因它不起作用。为什么会这样我真的不明白...

CSS

html{
  background: url(http://img.pixland.uz/u841f174959.jpg
  ) no-repeat center center fixed;
  background-size: cover;
  opacity: 1; <!-- if i decrease opacity 1 to 0.9 it will become very small   -->
}

demo

最佳答案

Have a fiddle!

CSS

html,body{
  background: url(http://img.pixland.uz/u841f174959.jpg) no-repeat center center fixed;
   background-size: cover;
  opacity: 0.5;
  height: 100%;    
}

关于css - opacity 属性有一些问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23880571/

相关文章:

html - 你能在 Firebug "sticky?"中设置悬停状态吗

html - 将最大宽度应用于相对定位的 Div 中的固定位置的 Div?

html - 如何使div中的文本不超出其宽度

javascript - 当元素的底部边缘滚动到 View 中时使元素固定

javascript - Material UI - 展开面板不会缩小上面的 div

css - 为什么从 div 中删除边框会破坏我的布局?

html - 垂直增长元素,同时定位到其他元素的右侧

javascript - 如何使输入内联显示?

html - 列不对齐

html - 我需要画 2 个用线连接的圆圈?仅在 CSS 中