【问题标题】:How to avoid Background Image overlapping the Blocks如何避免背景图像与块重叠
【发布时间】:2018-08-13 12:21:20
【问题描述】:

我在我的 drupal 7 门户的背景中插入了一张图片。它的 css 是 ...

代码:

* {
  box-sizing: border-box;
  text-align: center;
  background-image: 
   url
('https://xx.xxx.xx.xxx/devuser/sites/all/BackgroundWallpapersforPortal/blue 
    image.jpg') !important;
 background-color:none;
 }

但是,有了这个,我的图像看起来像这样 -

我不希望我的背景图片与块重叠。我访问过几个网站,它们的背景图片不会与每个新声明/每个新实体重叠。它一直嵌入到背景中。请帮忙。

我想实现这一点 - 块也可见并且还有背景图像。

【问题讨论】:

  • 你知道*的使用吗?
  • 我尝试了 body{ ...//code} ..但它不起作用。
  • 是的,但您知道* 是什么意思吗? ..你不想要你明确做过的事情
  • 好的...我弄错了...但是...解决方案是什么?
  • 这取决于你想要什么......你的问题是你不想要每个元素的背景,所以你不需要使用那个 CSS。大功告成,现在说明你想要达到的目标

标签: css drupal-7


【解决方案1】:

您只需将背景设置为您想要的特定元素,而不是所有内容。例如,为您的菜单项设置一个名为“导航”的类,并像这样设置 CSS:

.navigation{
     background-image: url('https://xx.xxx.xx.xxx/devuser/sites/all/BackgroundWallpapersforPortal/blue 
image.jpg') !important;
}

【讨论】:

    猜你喜欢
    • 2023-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多