The vertical scrollbar is shifting the content to the side, causing a horizontal scrollbar to

Currently, I am working on a web page located at this link:

My main focus at the moment is positioning an image in such a way that it appears to be coming out of the right side of the screen. Progress so far is looking promising.

However, I have noticed that when I connect a mouse to my Mac using Safari, a vertical scrollbar appears on the screen. This causes a portion of the image (the width of the scrollbar) to extend beyond the edge of the screen, resulting in a horizontal scrollbar being displayed as well.

The HTML/CSS related to the image and its container are shown below:

<div class="col-md-6 image-col">
     <div class="image-container">
          <img class="contact-graphic" src="/assets/contact-us-graphic.png" />
     </div>

</div>

.image-container {
    height:70vh;
}
img.contact-graphic {
    height:100%;
    border-radius:5px;
}
.image-col {
    padding-right:0 !important;
    padding-left:0;
    margin-right:0 !important;
    overflow-x:hidden !important;
    width:50vw !important;
    margin-right:-50vw!important;
    display:inline-block;
}

I have a feeling that there may be room for improvement in this CSS code. Any suggestions or feedback would be greatly appreciated.

Thank you!

Answer №1

Delete the width: 50vw!important; line from the CSS rule for .image-col! This is essential for proper alignment within the bootstrap grid system.

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

Having difficulty with submitting a modal form via Ajax Request in Laravel

Attempting to delete a user based on input from a modal form, but encountering difficulty. No error message is showing in the console. As a beginner, struggling to pinpoint the mistake. Error: Ajax request issue. Code snippet below: Blade modal section: ...

working with css to rearrange 3 divs

I am trying to rearrange the positioning of two divs within my HTML code: <div>container <div> Navigation backwards </div> <div> Social buttons </div> <div> Navigation forwards </div> </div> This setup disp ...

Utilizing Python for replacing all hyperlinks on an HTML page with local addresses

As someone who is new to working with html pages in python, I am currently attempting to create a basic web-crawler. Having successfully downloaded all the links from the website I am working on, my next goal is to transition to offline functionality by ...

Adjusting Header Image to Match Screen Dimensions

I am currently struggling to make the header image on my new WordPress website resize dynamically based on the device I am using to view it. Despite trying various suggestions from different sources, I have not been able to achieve the desired result. The ...

PHP and MySQL commands for selecting and inserting data

I recently added a search function to my website and managed to successfully display the rows from the database. However, I'm facing a challenge with a specific aspect: For instance, when I search for names starting with the letter J, I want to list ...

Show the res.send() method from express.js without replacing the existing html content

Currently, I am in the process of developing a calculator application using express.js. The app needs to handle get requests for an HTML file and post requests that capture user input and provide the response accurately. My challenge lies in showcasing the ...

Issues with displaying video content and controlling the Bootstrap 5 video carousel

I have encountered an issue while coding a website for a friend's company. He requested a video carousel to be added to his existing site, so I incorporated links and scripts for Bootstrap in order to create a gallery for his products and a carousel t ...

Delayed loading of CSS within app-root component in Angular

Currently, I am working on integrating an animation when the app starts within the contents of <app-root>...</app-root>. To achieve this, I have made the following changes: <app-root> <style> h1 { font-family: &ap ...

Enhance the appearance of your PrimeNG dropdown by incorporating custom font sizes and trigger icon sizes

Struggling with customizing the font size and dropdown trigger icon styling of a PrimeNG dropdown in my Angular TypeScript application. The documentation for PrimeNG's styling options is unclear, making it difficult to achieve the desired customizatio ...

The collapsible section expands upon loading the page

Trying to implement Disqus as a plugin on my test webpage, I created a collapsible section with a "Show comments" button. The idea was to hide the plugin by default and reveal it only when users click on "Show comments". Despite using the w3schools example ...

Is there a tool available for minimizing PHP, CSS, and JavaScript

I have a unique method for managing my css and javascript resources. Therefore, when I am prepared, I compile a list of css and javascript files. My goal is to create a function that can generate a path to a compressed and merged css and js file. For ex ...

Having trouble accessing the input class with jQuery

When I click the "Reset To Default Settings" button in my form, I want to clear the default colors in my 4 color pickers. Each of them has an input type text field with the class anyicon-form-colorpicker. To achieve this, I locate the <a> tag and use ...

Trigger a sound or notification whenever a specific user sends a message on a pre-existing website

As a user of a website featuring a chat widget for communication with instructors, I have a specific request. I would like to receive an audio notification whenever the instructor sends a message, and perhaps even a browser notification if possible. It is ...

Issue with Bootstrap Nav Pills only functioning properly for the initial option

When using Bootstrap nav pills, only the first one seems to work properly in my case. Even though I have inserted forms for each nav pill, it only shows a blank page. https://i.sstatic.net/QsL1l.png https://i.sstatic.net/Swmtq.png I have PHP code inside t ...

Autosuggest Feature in Google Maps

Can someone please help me with customizing the width of the input text box and drop down menu using this resource: https://developers.google.com/maps/documentation/javascript/places#places_autocomplete? I'm having trouble figuring it out. ...

Change an image seamlessly without any flickering, and display the new one instantaneously

TL;DR: How can images be swapped smoothly without causing page flicker while indicating loading status? I am facing an issue with swapping between 2 images using buttons. The first image loads fine, but the second image doesn't display until it' ...

Ways to transform a poster into a clickable link in an HTML video

I am currently working on embedding an mp3 audio file in a browser, along with an accompanying image and a URL for redirection upon clicking. To achieve this, I have placed the mp3 file within a video tag and designated the image as a poster using the foll ...

The type 'Observable<DataListItem[]>' cannot be assigned to type 'DataListItem[]'

Error message details: "The type 'Observable' is not compatible with the type 'DataListeItem[]'. The 'includes' property is missing in the 'Observable' type." I am currently using the Material Table Schematic an ...

Animating content using CSS keyframes for dynamic changes

I'm trying to change the text of a div using keyframes with the code content:'text';, but unfortunately, the div remains empty and nothing happens. The content inside the #neon-sign div is not updating and stays blank: #neon-sign { p ...

Guide to positioning a top navigation menu with dropdown items in the center using CSS: absolute positioning

I have implemented a pure CSS menu from this source on my website. It functions properly in the 'hamburger menu' mode, but I am encountering difficulties when attempting to center or right-align the menu in other modes. Despite trying various so ...