Also, your html structure will break as its not proper. How to overlay one div over another div using CSS. Thanks for contributing an answer to Stack Overflow! How to place text on image using HTML and CSS? I am trying to build a web page with an image that fills the screen and re-sizes to the same percentage when the height is changed. For this article, well continue on with the grid we used in my first CSS Grid article. Bootstrap uses HTML, CSS and jQuery to make responsive web pages. Now the final step is to add the images. .container > div > img { width: 100%; height: 100%; object-fit: cover; } Which ends up like the following: And that's it! You are missing the width:100% and also add top:100% to the #homepageRightImg. DP. . 4. You'll need to add a meta tag to identify the width and media queries to perform an action when the width is different. The width property for the div element in the @media query for screen size is set to less than or equal to 500px. Lets change each of the columns to be one fraction unit wide. If you are after responsive design, try to use fixed values as little as possible. The width property for the "div" element in the @media query for screen size is set to less than or equal to "500px". If the max-width property is set to 100%, the image will scale down if it has to, but never scale up to be larger than its original size: The HTML