CSS - Increasing the Size of a Background Image

Having trouble scaling my background image without causing horizontal and vertical scroll bars to appear. I tried removing childDiv and setting max-height and max-width, but no luck.

It seems like the image is increasing in width and height rather than being zoomed into.

Here's my code:


/* Chrome, Safari, Opera */
@-webkit-keyframes zoom {
  from {
    -webkit-transform: scale(1, 1);
  }
  to {
    -webkit-transform: scale(1.2, 1.2);
  }
}
/* Standard syntax */
@keyframes zoom {
  from {
    transform: scale(1, 1);
  }
  to {
    transform: scale(1.2, 1.2);
  }
}
.homeDivParent {
  height: 100%;
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(100, 100, 100, 0.1)), url("/assets/images/bgHome.jpg");
  background-position: 20% 0%;
  background-color: #fafafa;
  -webkit-animation: zoom 10s;
  animation: zoom 10s;
}
.homeDivChild {
  text-align: center;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}

Any suggestions on how to fix this issue?

Answer №1

It's a bit unclear to me, but are you trying to eliminate the scroll bars?

.mainContent {
    scrollbar-width: none;
}

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 it possible to install non-root dependencies in node_modules using NPM?

The repository @superflycss/component-navbox contains the following list of dependencies: "devDependencies": { "@superflycss/component-body": "^1.0.1", "@superflycss/component-display": "^1.0.2", "@superflycss/component-header" ...

Ways to extract the coordinates for slices positioned around the circumference of a pie chart

Currently, I am working on designing a pie chart with D3 using d3.layout.pie(). The image resembles the one displayed below, but without the black dots. These dots were added manually in Photoshop to highlight an issue that I am facing. I am curious about ...

jQuery inadvertently removes hyperlinks from the page

Here's the jQuery code I'm currently using: function getUrlParameter(name) { var pageURL = window.location.search.substring(1); var URLVariables = pageURL.split('&'); for (var i = 0; i < URLVariables.length; i++) { ...

Ways to showcase a textbox input in different DIVs multiple times

I am struggling to showcase the content of a textarea within multiple div elements when a user inputs text. The value only appears in the first div, but I want it to display in every div. Here is my HTML and jQuery code: <input type="textarea" id="my ...

Selecting an option from a dropdown menu in Selenium updates the selection within the program, but it does

Encountering an issue with Selenium and Java. Attempting to extract information from an HTML page's dropdown menu for my Java Project. Despite using different selections on the dropdown menu, the URL remains unchanged. After countless attempts to cha ...

Shift all content to the right when viewing on mobile devices

I'm looking to create space for a menu on the left side, similar to the one on Mashable's mobile view. How can I move all the content to the right? Feel free to resize the window and compare with . Thank you. Best regards, Marius ...

Ways to Retrieve the Text From the Selected Index in Datalist Element

I need to extract the inner text of the option tag using pure JavaScript This is the HTML code I am working with: <input list="in" name="i_n" class="form-control" placeholder="Enter Item Name" required> <datalist id="in" onChange="rate(this)"&g ...

Switching the theme color from drab grey to vibrant blue

How can I change the default placeholder color in md-input-container from grey to Material Blue? I have followed the instructions in the documentation and created my own theme, but none of the code snippets seems to work. What am I doing wrong? mainApp. ...

Using Python and Scrapy: Identifying whether a webpage is in HTML format or not

I'm working on a Scrapy spider that needs to determine whether a page it downloads is in html format or not. The website I want the spider to crawl contains links to both pdf and html files. If the spider encounters a pdf file, it should process the r ...

Tips for preloading icon font in Angular server-side rendering (SSR)

Is it possible to preload icons and fonts before the HTML content is rendered? I have been using a preload strategy to try and achieve this. index.html <!doctype html> <html lang="en"> <head> <meta charset="utf-8&quo ...

Can JavaScript values be passed into CSS styles?

I am currently working on dynamically updating the width of a CSS line based on a JavaScript value (a percentage). The line is currently set at 30%, but I would like to replace that hard-coded value with my JavaScript variable (c2_percent) to make it mor ...

pick out particular values from an array

I have a question that may seem basic to some, but I'm curious about how to select specific elements from an array. In this case, I have an array with 100 elements: var cubes = [element1, element2, element3 ...] and I want to select elements 25-35. ...

Is there a way for me to determine if I am accurately interpreting the content on websites?

I created this function to check for any changes on a website. However, I have noticed that it produces incorrect results when tested on unchanged websites. Can you help me identify the issue and determine if there is indeed a problem? Here's the code ...

Where can I find the specific code needed to create this button style?

There is a button here for adding an event, but unfortunately, the style code is not displayed. Is there a way to obtain the full cascading style sheet for this button? ( ) ...

Utilizing CSS grid layouts to ensure images expand to fit the dimensions of the designated column and

I am currently working with a CSS grid layout that is displaying as follows: .image__gallery-grid { max-height: none; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 2.5rem; dis ...

Separating the total number from my group using SQLAlchemy and Flask

I'm facing an issue with displaying a table that shows the sales amount of a particular car model. Similar to this one: https://i.sstatic.net/msTUH.png The problem is, I can't figure out how to separate the counted amount from the model. Is ther ...

Issue: The property 'top' cannot be read as it is null

I'm trying to access the top of my footer, but I keep encountering this error message: Cannot read property 'top' of null Here is the HTML code: <footer class="footer" role="complementary" id="myfooter"> </footer> And in jQuer ...

A guide to integrating the YouTube player and Facebook API with Bootstrap 3

Hello everyone! Hey there, I'm Cody, a student and amateur web designer. I recently got the opportunity to work on a website for a family friend. I've been using bootstrap3 to ensure the site is responsive, but I've run into an issue while ...

Tips for showcasing a SQL INNER JOIN in HTML using Flask

I'm struggling with displaying a value from another table, and it would be easier to comprehend with the code provided below: contact.py def index(): db = get_db() contacts = db.execute( 'SELECT *' ' FROM conta ...

Problem encountered in AngularJS CheckBox binding where the checkbox remains unchecked despite the model having a checked value

I am working with AngularJS and have implemented the following code: <div > <input type="checkbox" ng-model="vehicleDetails.selfOwned"> Owned </div> <div> {{vehicleDetails.selfOwned}} </div> The mo ...