Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-mini-2024-07-18· OpenAIAi2 WildChat-4.8M (AI2)

.backg { z-index:0; cursor: url(swasticock2.png), auto;…

  1. User

    .backg { z-index:0; cursor: url(swasticock2.png), auto; background-image:url(ng.akoij7.gif); background-repeat:repeat; position:fixed; size:50%; width:100%; height:100%; } works fine on pc, but mobile, I want the pic to be repeated alot like on pc. On mobile, it just shows half the image and boom not the rest

  2. Assistant

    To ensure that your background image repeats properly on mobile devices, you may need to adjust the CSS properties related to the size and positioning of the background. In your current CSS, you have set the background to repeat, which is correct, but let's make sure that it is configured in a way that is responsive across different devices.

    Here are a few adjustments you might want to make:

    1. Remove or Adjust the size Property: The property size: 50%; is not valid for an element's style. If you were attempting to modify the background size, you could use the background-size property instead.

    2. Set Background Size: You can set the background-size to auto or contain, but to achieve a repeating effect, make sure it is set to auto.

    3. Media Queries: To ensure that styles look good on mobile, you can use media queries to adjust styles based on the screen size.

    Here's a modified version of your CSS with these considerations:

    .backg {
        z-index: 0;
        cursor: url(swasticock2.png), auto; 
        background-image: url(ng.akoij7.gif);
        background-repeat: repeat; 
        background-size: auto; /* Ensure original size for repetition */
        position: fixed; 
        width: 100%;
        height: 100%; 
        overflow: hidden; /* Avoid overflow issues */
    }
    
    @media (max-width: 600px) { /* Adjust according to desired breakpoint */
        .backg {
            background-size: auto; /* Repeat the image naturally */
        }
    }
    

    Additional Tips:

    • Viewport Units: Ensure that the design is responsive by using percentage-based or viewport units where applicable.
    • Image Size and Resolution: Ensure that the image being used is of appropriate size and resolution to ensure it looks good on mobile as well.
    • Testing: After making the adjustments, test on multiple mobile devices and orientations to see how the background behaves.

    With these updates, your background image should repeat properly on mobile devices, mimicking how it looks on a PC.