简体   繁体   English

CSS内容/边栏遵循背景

[英]CSS-Content/Sidebars follow Background

I am using Drupal-Zen Theme. 我正在使用Drupal-Zen主题。 What would I need to do if I want ALL the website content(like sidebars) to follow the background when the Browser size is adjusted? 调整浏览器大小后,如果我希望所有网站内容(如侧边栏)都遵循背景,该怎么办?

Example: Say I have a block with the letter C and I have a background image with the letter C. They both look like one letter when the browser resolutions is 980x1120 (example). 示例:假设我有一个带字母C的块,一个背景图像带有字母C。当浏览器分辨率为980x1120时,它们看起来都像一个字母(示例)。 But I want the block to expand with the background so C looks like the same no matter if the resolution was 180x320 or 2400x3200 for example. 但是我希望该块随着背景扩展,因此无论分辨率是180x320还是2400x3200,C看起来都是一样的。

You should be able to achieve this result using background size: 您应该能够使用背景大小实现以下结果:

#my_container {
    background-size: 100% auto;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM