Hidden Div Element Issue in Safari Browser

Having an issue with two of my divs not appearing in Safari, while they show up perfectly fine on Chrome and Firefox. The buttons labeled as .phquote and .designquote are not displaying on the initial page load. More details can be found by inspecting my website at

I've already checked for any image-related problems but that doesn't seem to be the cause. Even after removing the images and simply adding a background color to the div, the issue persists.

If anyone could assist me in resolving this matter, I would greatly appreciate it.

Below is the code snippet:

HTML

<main>
      <div id="homebanner">
        <div class="bannerbuttons">
            <a href="photography.html" class="phquote"></a>
            <a href="myfavorites.html" class="designquote"></a>
            <a href="contact.php" class="contactbtn"></a>
        </div>
    </div>
</main>

CSS

#homebanner {
    background-image: url("Images2/home.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    height: 500px;
    margin-top: -33px;
}
.contactbtn {
    display: none;
}
.bannerbuttons {
    width: 55%;
    margin: 0 auto;
}

.phquote {
    float: left;
    width: 50%;
    height: 45%;
    margin-top: 40px;
    background-repeat: no-repeat;
    background-image: url("/Images2/ph-quote-400.png");
    -o-background-size: contain;
    -moz-background-size: contain;
    -webkit-background-size: contain;
}

.phquote:hover {
    background-repeat: no-repeat;
    background-image: url("Images2/ph-quote-hover-400.png");
-o-background-size: contain;
    -moz-background-size: contain;
    -webkit-background-size: contain;
}

.designquote {
    float: left;
    width: 50%;
    height: 45%;
    margin-top: 190px;
    background-repeat: no-repeat;
    background-image: url("Images2/design-quote-400.png");
    -o-background-size: contain;
    -moz-background-size: contain;
    -webkit-background-size: contain;
}

.designquote:hover {
    background-repeat: no-repeat;
    background-image: url("Images2/design-quote-hover-400.png");
    -o-background-size: contain;
    -moz-background-size: contain;
    -webkit-background-size: contain;
}

Answer №1

There have been instances where Safari fails to display flexbox properly in my experience.

Adding a specific value to the flex property like flex: 1 0 auto has helped resolve the issue for me.

Answer №2

Add the CSS property "height:100%" to the .bannerbuttons class

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

How can I make a div or iframe stretch to fill the remaining space using javascript, jQuery, or css?

I'm looking for a way to make the middle iframe dynamically fill the remaining space between two fixed height iframes (one at the top and one at the bottom) regardless of the window screen size. Is there a technique or method that can achieve this? th ...

Issue with Safari causing footer to sporadically appear over overlay

I am encountering a problem with my webpage that has a sticky footer, scrolling content, and an overlay that appears after a few seconds. The issue is specific to Safari on certain devices like iPhone 12-15, where the footer and part of the scrolling conte ...

The viewport width in NextJS does not extend across the entire screen on mobile devices

I'm currently tackling a challenge with my NextJS Website project. It's the first time this issue has arisen for me. Typically, I set the body width to 100% or 100vw and everything works smoothly. However, upon switching to a mobile device, I not ...

Organize elements in a grid using CSS styling

I have designed a layout using grids, featuring two menus on the left and right, with a central area for content. Within the content area, there is a 4x4 grid layout. Here's an example of the 4x4-grid layout: https://codepen.io/mannberg/pen/qemayy h ...

Troubles with horizontal list incompatibility in Internet Explorer 6 and 7

I am facing an issue with displaying an unordered list in IE6+7. The problem arises when styling the list items with specific width and height properties, causing IE to stack the items vertically instead of horizontally. Below is my code snippet: For live ...

Unable to retrieve information from phpMyAdmin

I have successfully created forms similar to this before and they were working perfectly. However, I am facing an issue with the last two forms as they display a warning message - "Undefined variable: reg_no and cost." I have tried following the same algor ...

Navigating vertically using CSS letters is an effective way to

I'm brand new to this and I'm attempting to create a vertical navigation menu where the links and letters are also positioned vertically. Although I've managed to make everything vertical, I am now facing an issue with the links getting squi ...

Which method results in quicker rendering of gradients on browsers: using CSS or an image?

As I embark on developing a visually rich website with a multi-stop linear gradient as the background, one question plagues my mind – will browsers render it faster if I use CSS3 for the gradient or create a png image with background-size: cover;? My fo ...

What is the best way to limit a table overflow to stay within its row boundary?

Is it possible to truncate a table within a div in such a way that the overflow occurs on a row boundary? The table can have arbitrary rows and sometimes expands to accommodate more than one line of text. The div itself has a fixed height with overflow:hid ...

Applying Tailwind styles to dynamically inserted child nodes within a parent div

Currently, I am in the process of transitioning my website stacktips.com from using Bootstrap to Tailwind CSS. While initially, it seemed like a simple task and I was able to replace all the static HTML with tailwind classes successfully. However, now I ha ...

What advantages does KnockoutJS offer over AngularJS?

Can KnockoutJS offer a unique feature that rivals or exceeds those of AngularJS? ...

Having trouble importing JS into HTML file with NodeJS

I have created a web server using NodeJS that serves the file index.html. However, when I attempt to add a JavaScript file to my HTML document, the browser displays an error message stating The resource "http://localhost:3000/includes/main.js" was blocked ...

Different sources for multiple iframes

Greetings everyone, I am facing an issue with multiple iframes on my page, each with a different src attribute. Despite specifying unique sources for each iframe, upon loading the page, they all seem to be loaded with the same src. <html><body&g ...

The onclick event of the button is capturing the i tag rather than the button itself

Looking for a way to capture the 'id' of a button when it is clicked? <button id={props.id} onClick={props.handleClick} className="btn btn-circle" > <i class="fas fa-angle-down"></i> </button &g ...

h1 does not center align properly when there is insufficient text below

It seems that my h1 only aligns to the center of the screen when there is enough text underneath it. Otherwise, it doesn't align correctly or at all. How can I resolve this alignment issue? .content { margin-top: 60px; text-align: center; } bo ...

The function of the "enter/next" key on mobile browsers when inputting into a numeric field

I am working on a piece of code that only allows number inputs in a specific box. Previously, I used type="text", but this resulted in the full keyboard appearing on mobile browsers by default. To solve this issue, I switched to type="number". While mobile ...

developing both vertical and horizontal 'cross out'

I'm attempting to add a 'spacer' between buttons on my website using the word "or" with a vertical line centered above and below it. I've tried HTML <div class="footer-btn-wrap"> <div class="decor"><a href="... < ...

Learn the process of capturing an entire line of input from MySQL within an HTML PHP environment

I have a database field that contains a sentence as a varchar, for example, "Hello I am online." I want to display that field as an input placeholder. When I write the following code, it only shows "Hello," but if I use the echo command, it displays the fu ...

Numerous pop-up windows displaying a variety of distinct content in each one

While working on a website, I came across a helpful jQuery pop-up function that I found on Stack Overflow. The original post can be found here. I am trying to customize each pop-up box so they contain different content from the .pop1 and .pop2 divs (parag ...

Managing the order of rows in Bootstrap specifically for mobile devices

Take a look at this simple HTML snippet on this fiddle that illustrates a specific layout on wide desktop screens: Here is the code responsible for rendering the above layout: <div class="container"> <div class="row"> <div class="col-md-4" ...