【问题标题】:How to make a post background semi-transparent without making the content transparent?如何在不使内容透明的情况下使帖子背景半透明?
【发布时间】:2013-07-30 04:47:59
【问题描述】:

我查看了大量与我的问题相关的帖子,但没有人真正拥有相同的 html,所以我无法弄清楚。

我正在尝试使我的 tumblr 博客的帖子背景半透明,而不使帖子上的照片、视频、文本等透明。现在我有

   #left-column .post {
    opacity: 0.5;
    filter: alpha(opacity=50);
    z-index: -1;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    float: left;
    padding-top: 20px;
    width: 520px;
    }

我确定我需要为这个问题提供更多代码。如果您有任何要求,我会复制/粘贴到这里。另外,我只知道 html/css 的基础知识,所以如果我不立即理解某些内容,我会提出一两个问题。谢谢。

【问题讨论】:

标签: html transparency blogs tumblr


【解决方案1】:

使用 RGBa(红绿蓝Alpha

background-color: rgba(255,255,255,0.5);

所以你的代码是

#left-column .post {
    z-index: -1;
    background-color: rgba(255,255,255,0.5);
    border: 1px solid #ccc;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    float: left;
    padding-top: 20px;
    width: 520px;
}

【讨论】:

  • 到我的博客?哈哈,我会 fork 我的 html 但不是我的博客
  • 那么,如果我们看不到正在运行的页面,我猜你很不走运
  • 我现在正在处理它,它看起来很乱,但我猜是leiomano.tumblr.com
  • 也许您使用的是旧版浏览器?我看到它在我的浏览器上运行 d.pr/i/zVAG
  • 实际上我恢复到旧设置,但很明显,如果我将其更改为 ~0.8 不透明度,它不仅会更改帖子背景
【解决方案2】:

你可以使用这个网站http://hex2rgba.devoth.com/ 来制作你需要的背景,透明到什么颜色

试试这个代码:

#left-column .post {
 background: rgba(255, 255, 255, 0.5);
 border: 1px solid #ccc;
 border-radius: 5px;
 -moz-border-radius: 5px;
 -webkit-border-radius: 5px;
 float: left;
 padding-top: 20px;
 width: 520px;
}

rgba(255, 255, 255, 0.5) = #FFF

【讨论】:

  • 谢谢,但这几乎是其他人告诉我的,但它并没有真正起作用
猜你喜欢
  • 2022-09-23
  • 2011-09-15
  • 2015-11-12
  • 1970-01-01
  • 2017-11-08
  • 2021-10-17
  • 2017-06-04
  • 2012-07-27
  • 1970-01-01
相关资源
最近更新 更多