The issue of background repetition persists exclusively on Chrome, even after implementing the 'no-repeat' property

I'm struggling to figure out why my background keeps repeating in CSS even though I've used the no-repeat property. I want to avoid using the background-cover option as it distorts the image, and this issue seems to be specific to Chrome.

Check out the link here

I've tried everything from adding no-repeat, running the code through chatgpt, checking the image URL, testing on different browsers, to recommitting different versions of the codebase.

  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>

Answer №1

My website has some HTML code

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

                Click Me</button>
            <div id='output'>Click the button for inspiration</div>
        </div>


    </div>
</div>

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

#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;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is there a method to change the name of a file and have it automatically updated in all other locations where it is referenced?

I need to change the name of an HTML file within Visual Studio Code, but this file is referenced in multiple other files. Is there a quick way to do this? Are there any shortcuts that will let me rename the file and automatically update all references in ...

Mapping the Way: Innovative Controls for Navigation

Currently, I am utilizing the HERE maps API for JavaScript. However, I would like to customize the design of the map controls similar to this: Below is an example for reference: HERE EXAMPLE Is it feasible to achieve this customization? ...

Which variables are accepted in the HTML <script> language?

<script type="text/JavaScript1.2" ... <script type="text/JavaScript" ... Do these script declarations impact the way JavaScript is executed? ...

What are the challenges associated with using replaceChild?

function getLatestVideos(url) { var http = new XMLHttpRequest(); http.open("GET", url, false); // false for synchronous request http.send(null); return http.responseText; } var videosText = getLatestVideos("https://www.googleapis.com/youtube/v3/se ...

What could be causing my HTML website to load slowly and freeze when I switch to another program?

I am in the process of creating three websites. Two of them are functioning perfectly fine, but I am encountering a speed issue with the third one. Sometimes it loads slowly initially, but if I wait a bit longer, it eventually loads and works well. However ...

Tips for creating an expandable div with floated content

I am looking to create a flexible div that expands based on its content. Inside this div, there are two floated left divs with fixed widths. These inner divs should also expand according to their text content. To clear the floats, there is another div wi ...

How can I use jQuery to set a background image and position on a website?

I am trying to incorporate a background image fade effect along with the color fade in and out when hovering over a link using my current code. However, I am unsure of how to set the background image and position within the code. $(document).ready(funct ...

Repurposing components like custom text inputs, spans, and more in ASP.NET MVC using Razor

Our team is currently working on a website project where we keep re-using components repeatedly. One particular instance involves a span that functions as a warning light. It's accompanied by some C# code with properties for color and text, Javascript ...

Tips for positioning button to the right of a text box in Bootstrap

Is there a way to align my button with my text boxes so that the right sides form a straight line? I've been struggling to achieve this without using margin-left (as it only works for one screen size). https://i.sstatic.net/RrEYV.png I attempted to ...

Having trouble implementing a multi-level sub menu in a popup menu in Vue.js?

data: { menuItems: [{ name: 'Item 1', children: [{ name: 'Subitem 1' }, { name: 'Subitem 2' }, { name: 'Subitem 3' }] }, { ...

Update the style of elements on each iteration in Symfony2

I have implemented a collapsible CSS page for FAQs. While static text works fine, I am fetching questions and answers from the database which is causing an issue. In its standard CSS version, the collapsible FAQ appears as follows: <div clas ...

Using HTML nested lists in Wordpress sites

Working on nested, ordered lists using ol types and encountering an issue where the code appears correctly in Wordpress preview but displays incorrectly in Firefox and IE. The lists are showing as numbered instead of the specified types in the code provide ...

Unable to align a 1px element with the primary border

Can you please assist me? I would like to modify the CSS markup below in order to remove the 1 pixel added extra on the active clicked tab from my UL LI Tabbed Menu. How can this be achieved? Here is a picture of the issue: HTML Markup: <div class=" ...

Every time an input field is clicked, an email is sent

I'm struggling with the contact form on my website. Instead of sending an email after clicking on each input field, I want it to send only one email after hitting the submit button. Currently, it sends a total of 5 emails - 1 with user inputs and 4 wi ...

What steps do I need to take to make sure the Google font I downloaded is functioning properly in my React project

I have encountered an issue with using a Google font in my project... After downloading the font, I included the following CSS code: @font-face { font-family: "Work Sans"; src: local("Work Sans"), url(../src/Fonts/Work_Sans/Wor ...

Difficulty with alignment in the process of generating a vertical stepper using HTML and CSS

I'm currently working on developing a vertical stepper component using html & css with inspiration from this design. However, I've encountered some alignment issues in the css that I'm struggling to resolve. CSS .steps-container .step::b ...

How is it possible that I am able to view the font on this particular website?

Recently, I stumbled upon a fascinating website that allows users to experiment with various CSS3 features. As I examined the website's CSS code to enhance my own skills, I noticed something intriguing about the elegant "CSS3Gen" logo - it utilized a ...

Mobile site experiencing owl.carousel responsiveness issues after refreshing the page

I am currently working on a website located at . On the homepage, right after the slider, there is a carousel of three info boxes. However, in mobile view (developer mode), after a hard refresh or viewing the link on an actual mobile device, it displays a ...

A guide to showcasing tabs as a navigation menu based on media size using AngularJS

Help needed with creating a navigation menu that includes nav-icons on specific media screen sizes. The goal is to display all tabs as a list when clicking on the nav-icon. An attempt was made to implement a navbar, but it interfered with the tab styling. ...

The HTML5 ondrop event finishes executing before zip.js completes its operations

I'm facing a problem where I need to use a datatransferitemlist asynchronously, which contradicts the functionality outlined in the specifications. According to the specs, access to the dataTransfer.items collection is restricted once the event ends. ...