【发布时间】:2016-03-21 19:16:30
【问题描述】:
我正在创建的 wordpress 网站上有一个标题图片,它需要是任何浏览器的全宽。
父主题上已经存在的代码是:
background: url("/test/wp-content/themes/Howtopassyourexams.com/Theme/images/page-header-bg.jpg");
background-repeat: no-repeat;
background-position: center center;
-webkit-background-size: cover;
background-size: cover;
position: relative;
box-shadow: 0 7px 10px -10px #000;
width: 100%;
z-index: 0;
height: 300px;
margin-bottom: 80px;
在使用的主题上还有第二个样式表,它继承了父样式表的大部分样式,该样式表上的图像 CSS 是:
background: url("/test/wp-content/themes/Howtopassyourexams.com/Theme/images/page-header-bg.jpg");
width: 100%;
height: 300px;
我不确定为什么标题图像在两个样式表中有两个 css 代码,但主题就是这样来的,我不是这方面的专家,所以这可能是正常的。
即使将宽度更改为 100%,图像仍会保持原始尺寸 (1369x325px),因此在较小的浏览器上会删除其中的一部分。
如果我出错了,任何帮助都会很棒,网站地址:http://biobreak.co.uk/test/services/
谢谢。
【问题讨论】: