Issue with background-image resizing and not spanning full width

I am in the process of creating my very first website, which will serve as a portfolio. I have designed three different background images for each section that alternate (home, about, skills, etc.). Utilizing SASS with SCSS syntax, I have encountered an issue where resizing the window to reduce the total width causes the background image not to occupy the full width of the section, but rather stretch to the left side (this occurs below approximately 950px). Despite this setback, I am fond of the pattern I have discovered and would like to retain it. Below is an example of the code snippet from the 'about' section (although all sections are structured similarly), in hopes that someone can assist me in pinpointing my error. Interestingly, the stretching does not occur on the height axis; the website behaves as expected.

#about {
  @extend %section;
  @extend %background-light;
}

The following are the extensions:

%background-light {
  background-image: radial-gradient($background-dot-color2 1px, transparent 1px), radial-gradient($background-dot-color2 1px, transparent 1px);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
  background-color: $background-color2;
}

%section {
  padding: 2% 10% 5% 10%;
  scroll-margin-top: 8vh;
  height: auto;
  min-height: 92vh;
  width: 100%;

Additionally, these are the general properties assigned in my main style.scss file:

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: $font-stack;
}



html {
  scroll-behavior: smooth;
  cursor: default;
}

(the unusual min-height value was chosen due to a JavaScript function that ensures the header remains fixed during scrolling/section changes via the navbar, thus covering the full viewport height)

Strategies I've attempted:

- Removing other properties and applying only a background color to #about to see if the problem persists;


- Setting a min-width of 100vw to body/section and both; experimenting with setting a height and width of 100% to body/html and both;


- Eliminating the width:100% declaration from %section.

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

Trouble with parseJSON when handling form POST in Python

I'm struggling with a javascript HTML page that has an action POST to a python file, expecting a JSON response back. Despite my efforts, I can't figure out how to catch and parse the JSON data. The HTML and python code excerpts below should show ...

Troubleshooting problems with Bootstrap datepicker in a Vue project

I am facing a problem with the b-datepicker feature while trying to select a date. The dates are not appearing correctly, as shown in the image linked below. Here is my code: <b-form-group class="my-3" > <b-input-group> ...

Having trouble manipulating DOM elements in Node.js with JSDOM?

Feeling a bit lost here - I'm a newbie to Node JS and I'm attempting to manipulate a DOM element within index.js, my main Node.js file. After reading up on the jsdom module, which supposedly allows you to interact with HTML elements in Node, I t ...

How do I make the dropdown menu in a navbar stretch horizontally to cover the entire width of the page container?

When I hover over an item in the navbar, a horizontal dropdown menu currently opens as shown below (note the width of the dropdown menu): https://i.sstatic.net/824OVkWT.png What am I aiming for? I want to expand the horizontal dropdown menu like in the i ...

The jQuery change event functions smoothly on computers, but unfortunately, it fails to work on iOS devices

I've encountered an issue while developing a web application using Flask and jQuery. The change event works perfectly fine on PC web browsers, but it seems to be malfunctioning on iOS browsers. Let's take a look at the get_new_recipe_category.js ...

Tips for wrapping text within a span element that is positioned absolutely

Need a long string for the bullet text as shown in the code, they can't be separate words. Having trouble with overflow auto, it's cutting off the bullet text. The bullet text must remain in absolute position. How can I make the text wrap to t ...

How can I prevent my Bootstrap navbar from collapsing?

Is it possible to prevent my Bootstrap nav from collapsing when the page is minimized? I only have two elements in my navigation bar, and the Login button fits even when the page is minimized. /* Navigation */ .navbar-brand img { width:30%; heig ...

Converting HTML text input into a PHP variable

How can I achieve a html text input with name="input1" to be a php variable named $value? Here is what I have tried: <html> <form action="added.php" method="post" /> <p>Send a message to JANNES database: <input type="text" name="i ...

Troubleshooting innerHTML in jQuery

<script> $(document).ready(function() { var msg='{"ui":{"callData":[{"Title":"Caller Details", "Text":"<html><body><table border=&quot;1&quot;><tr><td>Caller details content</td></tr>< ...

When a child of a flex-item does not inherit the height of its parent in a flex container with a column direction and flex-basis set

Wow, that title was long! Let me try to clarify my confusion: So I have a flex-container with 2 flex items. <!-- HTML --> <div class="container"> <div class="item-1"> <div class="child-of-item-1"></div> < ...

What advantages does the use of $(e).attr(name,value) offer compared to using e.setAttribute(name,value)?

Scenario: The variable "e" represents an element of type "HtmlElement" and not a "css selector" I am referring to any attribute, not just the standard allowed ones like "atom-type" or "data-atom-type". Regardless of the attribute name, will it function wi ...

Disable input with Safari colored background and transparency

Why does the CSS color #b3b3b3 turned white on a disabled input? What could be causing this and how can it be fixed? Take a look at this code snippet: https://jsfiddle.net/esty6t20/ CSS: .transp { background-color: transparent; } .bug-color { color: ...

Show a variety of pictures in a random arrangement?

Looking for some help here! I'm trying to shuffle my images in a random order each time the page is refreshed. It's like a game of musical chairs but with pictures! Does anyone know how to achieve this? I've done some searching, but haven& ...

Styling Profile Cards with EJS

I am currently working on refining the layout of this project. My objective is to have a "for each" card generated from server data entry, and have them displayed in rows, ensuring that there are three cards per row. However, my current code is not format ...

What could be causing the content to disappear when switching from flex: column to flex: row?

In the code snippet provided below, you may notice that when the screen size is less than 768px, the video and content underneath it are visible. However, as soon as the screen size exceeds 768px, the video disappears. Have you ever wondered why the video ...

Unable to sort the list items when utilizing the load() function

I have multiple li elements within a ul and I am using the following code to sort them in ascending order based on the data-percentage attribute: $(function() { $(".alll li").sort(sort_li).appendTo('.alll'); function sort_li(a, b) { re ...

Struggling to customize the style of bootstrap components

Struggling to get my custom css to take precedence over Bootstrap4 components in my Django project. I'm a beginner in front-end development and I'm hoping to articulate my question clearly. Note: This is an HTML sheet within a Django project. My ...

Crafting a traditional timepiece with canvas

Trying to create an analog clock using canvas. I wrote some code but I'm struggling with adjusting the speed of the clock hands (hours, minutes, and seconds). When I run the app, the hands are spinning too fast and leaving lines all over the clock. Is ...

Is there a possible CSS-only alternative to the calc() function that can be used as a fallback

I'm aware of a CSS backup plan for calc() in IE6-7. Also, I've come across an alternative using jQuery. But what about a CSS-only substitute for calc() specifically for IE8? Is there one available? ...

Using Mailto and styling with different formats like bold and italic

Is there a way to open the user's mail client with a formatted text? The text should have elements like bold, italic, or u̲n̲d̲e̲r̲l̲i̲n̲e̲d̲. I attempted to do this using the mailto method. However, it follows the guidelines of RFC 2368, ...