如何使用CSS更改Squarespace页面部分的背景?

huangapple go评论73阅读模式
英文:

How to change the background of a page section in Squarespace using CSS?

问题

我正在处理Squarespace页面索引的问题。我想要更改索引中的一个页面的背景为图像。我正在尝试更改seacureadvisors上“关于我们”部分的背景。索引的名称是SeacureAdvisors,我要更新背景的页面名称是Seacure Advisors按钮部分。

我已尝试以下CSS但未成功:

#seacureadvisors #seacure-button-section {
    background-image: url(https://static1.squarespace.com/static/5fce63b9abf5bd69920abec0/t/5fd2163da9eaf43bd85bc941/1607603780287/who+we+are+bg.png);
    background-repeat: no-repeat;
    background-size: cover;
}

div#block-c509aa91e20e639c15e8 {
    background-image: url(https://static1.squarespace.com/static/5fce63b9abf5bd69920abec0/t/5fd2163da9eaf43bd85bc941/1607603780287/who+we+are+bg.png);
    background-repeat: no-repeat;
    background-size: cover;
}

似乎都不起作用。请给予指导。

英文:

I working with an index of pages in Squarespace. For one page within that index I would like to change the background to be an image. I am trying to change the background of the "About Us" section on seacureadvisors. The name of the index is SeacureAdvisors, the name of the page I'm trying to update the background for is Seacure Advisors Button Section.

I have tried the following CSS with no luck:

#seacureadvisors #seacure-button-section {
    background-image: url(https://static1.squarespace.com/static/5fce63b9abf5bd69920abec0/t/5fd2163da9eaf43bd85bc941/1607603780287/who+we+are+bg.png);
    background-repeat: no-repeat;
    background-size: cover;
}

and

div#block-c509aa91e20e639c15e8 {
    background-image: url(https://static1.squarespace.com/static/5fce63b9abf5bd69920abec0/t/5fd2163da9eaf43bd85bc941/1607603780287/who+we+are+bg.png);
    background-repeat: no-repeat;
    background-size: cover;
}

Neither seems to work. Please advise.

答案1

得分: 0

这是您正在寻找的“选择器”:

#seacure-button-section div.index-section-wrapper.page-content{
    background: url(https://static1.squarespace.com/static/5fce63b9abf5bd69920abec0/t/5fd2163da9eaf43bd85bc941/1607603780287/who+we+are+bg.png);
    background-repeat: no-repeat;
    background-size: cover;
}
英文:

Here is the selector you are looking for:

#seacure-button-section div.index-section-wrapper.page-content{
    background: url(https://static1.squarespace.com/static/5fce63b9abf5bd69920abec0/t/5fd2163da9eaf43bd85bc941/1607603780287/who+we+are+bg.png);
    background-repeat: no-repeat;
    background-size: cover;
}

答案2

得分: 0

url() CSS函数的参数需要一个字符串。为了修复它,请将URL放在引号中,如下所示:

background-image: url("https://static1.squarespace.com/static/5fce63b9abf5bd69920abec0/t/5fd2163da9eaf43bd85bc941/1607603780287/who+we+are+bg.png");

此外,您的链接中包含空格,这也会导致URL无法正常工作。

英文:

The parameter of the url() css function requires a string. To fix it, put the URL into quotes, like so:

background-image: url("https://static1.squarespace.com/static/5fce63b9abf5bd69920abec0/t/5fd2163da9eaf43bd8   5bc941/1607603780287/who+we+are+bg.png");

Also, your link contains whitespace, which will also break the url.

huangapple
  • 本文由 发表于 2023年8月5日 07:20:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76839567.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定