简体   繁体   English

为什么我网站的这一部分有白色背景?

[英]Why is this section of my site having a white background?

I am working on a personal site, and every single section looks fine, but one is not getting the background color I want it to be. 我正在一个个人网站上工作,每个部分看起来都不错,但是没有得到我想要的背景颜色。 The bottom section, right above the about section (Opia Section) is the problem. 关于部分(Opia部分)正上方的底部是问题所在。 The website is Here . 该网站在这里 You can find the code at this github repo. 您可以在此github存储库中找到代码 Thanks! 谢谢!

That's the section with id #rileyscycles . 这是ID为#rileyscycles的部分。 It simply doesn't have a background defined for it - it has settings for background-position , background-size and background-repeat , but no background , background-image or background-color 它只是没有为它定义背景-它具有background-positionbackground-sizebackground-repeat ,但没有backgroundbackground-imagebackground-color

And none of its parent elements has a background that this section could inherit. 而且其父元素中没有一个具有本节可以继承的背景。

EDIT: As Dr Manish Joshi wrote: If you remove the "#" from the ID name, it finds the obviously intended CSS rule and is displayed with a background. 编辑:正如Manish Joshi博士所写:如果从ID名称中删除“#”,它将找到明显的预期CSS规则并显示背景。

In index page, around line number 160, 在索引页的第160行附近,

 <section id="specialized" class="spechover"> // Line no. around 126
                <div class="info">
                <div class="text">

 <section id="volcom" class="rileyshover"> // Line no. 147
                <div class="info">
                <div class="text">

 <section id="#rileyscycles" class="rileyshover"> //Line no. 160
                <div class="info">
                <div class="text">

There is # used in id while not used on other sections...so on line 160, try removing "#" in id. id中使用了#,而其他部分则未使用...所以在第160行,尝试删除id中的“#”。

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

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