背景仅在Chrome上重复-即使在添加“不重复”之后

jaxagkaj  于 2023-09-28  发布在  Go
关注(0)|答案(1)|浏览(80)

我需要找出为什么我的背景是重复在我的CSS,即使使用没有重复。我尽量避免使用背景覆盖,因为它扭曲了图像。这只是在Chrome上发生的事情。
https://natalyhelps.github.io/projects/inspiredquotes/inspiredquotes.html
我试着添加不重复。我试着把我的代码通过chatgpt。我检查了图像URL。我尝试在不同的浏览器访问。我试过重新提交不同的代码库。

body {
  background: url("http://natalyhelps.github.io/lotus.png");
  color: #5A5A5A;
  background-repeat: no-repeat;
  background-position: top;
}

#quotecontainer {
  background-color: rgba(255, 255, 255, 0.5);
  /* White with 50% opacity */
  height: auto;
  padding: 2%;
  margin-right: 10%;
}

#quote {
  letter-spacing: 1.7px;
  font-family: cambria;
  height: auto;
  width: 50%;
  text-align: center;
  margin: 1%;
  font-size: 1.4em;
  line-height: 1.6em;
  background-color: rgba(0, 0, 0, 0.1);
  padding-bottom: 10%;
  padding-left: 5%;
  padding-right: 5%;
}

#btn {
  margin: 50px auto;
  font-family: verdana;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
  /* Add box shadow when button is pressed */
  color: #5A5A5A;
  border: solid 1px rgba(245, 93, 180, .9);
  /* Equivalent to #FF69B4 */
  ;
  ;
  cursor: pointer;
  font-size: 1em;
  padding: 15px;
  border-radius: 25px;
  cursor: pointer;
  letter-spacing: 2px;
  position: relative;
  overflow: hidden;
  background-color: rgba(248, 96, 180, .9);
  /* Equivalent to #FF69B4 */
}

#btn:hover {
  background-color: rgba(245, 93, 180, 1);
  /* Equivalent to #FF69B4 */
  color: #5A5A5A;
  font-size: .9em;
  letter-spacing: 2.2px;
  #output {}
<div id='quotecontainer'>
  <div id='quote'>
    <button id='btn'>
      Press Me</button>
    <div id='output'>Press the button for wisdom</div>
  </div>
</div>
guz6ccqo

guz6ccqo1#

简体中文

<body>
<div id="container">
    <div id='quotecontainer'>
        <div id='quote'>
            <button id='btn'>

                Press Me</button>
            <div id='output'>Press the button for wisdom</div>
        </div>

    </div>
</div>

<script src="inspiredquotes.js"></script>
CSS code

#container {
    background: url("http://natalyhelps.github.io/lotus.png");
    /* color: #5A5A5A; */
    background-repeat: no-repeat;
    background-size: contain;
    background-origin: content-box;
    background-attachment: fixed;
    left: 0;
}

相关问题