英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论