Shifting components around with CSS

My website's home page appears differently on a 1920px screen (big desktop screen) versus a 1366px (15" laptop) screen.

While it looks perfect on the larger screen, there is a noticeable gap between the menu, text below, and the banner image on the smaller screen.

To address this issue, I've tried using a media query specifically for the 1366px screen. However, despite moving the text up successfully within the query, I'm struggling to move the banner image without affecting the text placement. Negative padding and margins haven't yielded the desired result. Can someone assist me in adjusting the positioning of the banner image or shed light on why this discrepancy occurs at this particular screen resolution? The website can be found at www.flowersforeveryone.co.za. Please note that the issue may vary depending on your resolution. I have also included an image for reference.

The CSS code snippet is provided below -

@media (min-width: 1300px) and (max-width: 1400px) {

.page-banner-wrap .page-banner > .container{
    margin-top: -100px;
    margin-bottom: 0px;
}

.page-banner-wrap .page-banner .page-header > .page-title{
    font-family: 'Source Sans Pro', sans-serif !important;
    margin-top: -100px;
    font-weight: 300;
    margin: 0 auto;
    max-width: 590px;
    font-size: 21pt;
    line-height: 1.2;
    word-wrap:break-word; max-width:38ch;
}

.page-banner-wrap .page-banner .banner-content{
    margin-top: 20px;
    margin-bottom: 0px;
}

#lsx-banner .tagline {
    font-size: 16pt;
    color: #000;
    font-weight: 300;
    text-transform: uppercase;
    padding-bottom: 20px;
}
.page-banner-wrap .page-banner > .page-banner-image{
    position: relative;
    height: 100vh;
    width: 100%;
    margin-bottom: 20px;
}
}

https://i.sstatic.net/4Vabv.png

Answer №1

Before moving forward, there are a few significant errors that need addressing :D Oh well.

In the midst of

<div class="page-banner-image" style="background-position: center center; background-image:url(https://flowersforeveryone.co.za/wp-content/uploads/2018/08/Home-3-1.png);"></div>

adjust the background position to

background-position: top center;

However, using those specific CSS properties may lead to unexpected results, I suggest utilizing

background-size: contain

instead of your current method. The revised code should resemble

background-size: contain;
background-position: top center;
background-size: contain;
width: 100%;
height: 100%;
background-image: url(https://flowersforeveryone.co.za/wp-content/uploads/2018/08/Home-3-1.png);

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 there a way to conceal a div class on the Payment page in Shopify?

I have encountered an issue with the code on the Shopify checkout (Payment) Page. Unfortunately, I am unable to directly edit this page within Shopify, but I have discovered that it is possible to add custom CSS or HTML code within the checkout settings of ...

What could be causing the Bootstrap ProgressBar to not show up?

Having an issue with the ProgressBar component from react-bootstrap: <ProgressBar now={dynamicValue} /> The value dynamicValue changes for each component. However, I am unable to get the progressBar to display in my case. ...

Managing multiple carousels simultaneously using the middle mouse button in Swiper.js

I am currently utilizing 5 carousels on my screen, all of which are operated by the same navigation buttons. In addition to this, I require the ability to control them using the middle mouse scroll. However, when I activate the mouse wheel control, only ...

Adjust hover effects based on true conditions

Currently working on a web app using HTML, CSS, JavaScript, and AngularJS. Progress so far includes a clickable box that triggers a javascript function to display more boxes upon click using ng-click. <div ng-click="!(clickEnabled)||myFunction(app)" cl ...

What steps should I take to ensure proper rendering of CSS in Django?

Hey there! I'm new to Django and I'm struggling to get my css to display properly. I'm trying to create a red notification, similar to Facebook, for my unread messages. But for some reason, my css isn't rendering. Can anyone point out w ...

Display a div in front of another using Material UI when hovering

Is there a way to display a black transparent div in front of a <MediaCard/> when hovering over it? Below is the code snippet I am using with Material UI: <Box> <Typography variant='h3'>Home Page</Typography> < ...

Guide to making a dropdown menu that pulls information from a text box and displays the location within the text

I'm currently working on a unique dropdown feature that functions like a regular text field, displaying the text position. To achieve this, I've constructed a hidden dropdown menu positioned beneath the text field. My goal is to develop a jQuery ...

Sync HTML Videos

Issue: I am currently developing a 3 column layout where certain columns need to remain sticky at the top of the viewport. In one section, I want to use the same video as a background for all 3 columns, with the specific effect of having the middle column ...

What is the best way to adjust the spacing in my bootstrap Navbar? I am struggling to make it stretch to the entire width of the screen

I am currently working on a website project where I want to have a navigation bar that spans the full width of the screen with a black background. I also need the links to be centered and evenly distributed within the navbar. My main issue right now is re ...

Ways to focus on a specific div using JavaScript

I am attempting to create a 'snow' effect on the background of a particular div with a red border. Here is the code, but you can also view it here: <!-- language: lang-js --> var width = getWidth(); var height = getH ...

What could be causing the background color opacity of the HTML hr tag to decrease?

I am trying to modify the height and background color of the <hr> HTML tag. However, even though the height and color are changing, it appears that the background color opacity is decreasing slightly. What could be causing this issue? Here is my cod ...

Use the given URL to set the background image

Having trouble setting a background image for an <a> tag. The image link is set in the background-image:url property, but the image isn't showing up as the background. Here's my code, what could be the issue? <a href="#" data-to ...

What is the best way to make twitter-bootstrap navbar subitems collapse/expand on smaller screens?

After experiencing success with the twitter-bootstrap 'hero' example, it has become evident that on small screens, the navbar menu only displays first-level items, with sub-items collapsed. However, tapping on an item with child elements expands ...

Tips for placing text alongside a logo while maintaining navigation links on the right side

I am a beginner in the world of CSS and have been working on a practice project. However, I am struggling to achieve what the title suggests. I attempted using the margin-right: auto method that I've learned from various tutorials, but it only ends u ...

How can I prevent or override the text being pushed to the right by CSS::before?

Using the css property ::before, I am attempting to insert a tag before a paragraph. While I am able to display the tag correctly, it is causing the text within the paragraph to be shifted to the right. Ideally, I would like the tag to appear in the top-le ...

I am having trouble setting the z-index for the navigation component in Tailwind CSS and Next.js

Currently, I am immersed in a Next.js project that utilizes Tailwind.css. Within this project, there is a header component known as nav, styled as follows: <div className="sticky top-0 z-100 body bg-white flex flex-row items-center">Nav con ...

bootstrap navigation bar collapsible menu

Struggling with making the hamburger menu appear on my friend's site. Spent hours trying to troubleshoot, but still can't figure out why it's only showing up as a red box and appearing on larger screens instead of just smaller devices. Frust ...

Utilizing Font-face and background images in asset-pipeline plugin: A comprehensive guide

I am currently using the asset-pipeline from CodeSleeve to handle my style sheets in my Laravel project. I have successfully downloaded the application.css file, but I have a question: how can I include images and use font-face in this setup? Here is a sn ...

Margin challenge in CSS

Just starting out with CSS, so please be patient with me. I'm currently working on customizing a form and everything is looking good, except for the confirmation label which is located in a div. I've managed to create space between other elements ...

Options chosen will vanish in a multi-select drop-down tag with a scroll bar in HTML

I need assistance with my multiple drop-down select tag issue. .CustomStyle { overflow-x: scroll; width: 16%; } <select multiple size="5" class="CustomStyle"> <option>Option 1</option> <option>Option 2</option> &l ...