Flexbox transforms Safari's Horizontal Nav into a Vertical layout

Issue with Horizontal Navigation Bar Turning Vertical in Safari I've been using flexbox to adjust the spacing and size of the li elements as the browser window size changes. Everything works perfectly fine in Chrome and Firefox, but for some reason, it switches to a vertical layout in Safari. This causes significant problems especially when trying to incorporate a sticky scroll navigation bar into the design.

I'm still relatively new to coding. I created my first website from scratch here as part of my portfolio, but it's hard to showcase my work if it doesn't display correctly on the main browsers such as Safari, Chrome, and Firefox. I have tried searching for solutions here, but nothing seems to address this specific issue.

I even checked caniuse.com (caniuse.com/#feat=flexbox) and reviewed the bugs mentioned there. However, this particular problem is not listed among the known issues on Github. I did come across a similar pen on Github (codepen.io/philipwalton/pen/NqLoNp), where they utilized 'display block' on .FlexItem (in my case, the li element) before applying it to .FlexContainer (navList). Unfortunately, that didn't solve my issue either.

relevant HTML —

<nav>
    <ul class="navList">
        <li><a href="index.html">Home</a></li>
        <li><a href="mLe_pages/mLe_PORTFOLIO.html">Portfolio</a></li>
        <li><a href="mLe_pages/mLe_ABOUT.html">About</a></li>
        <li><a href="mLe_pages/mLe_BLOG.html">Blog</a></li>
        <li><a href="mLe_pages/mLe_SAMPLE.html">Sample</a></li>
        <li><a href="mLe_pages/mLe_PROJECT.html">Project</a></li>
        <li><a href="mLe_pages/mLe_CONTACT.html">Contact</a></li>
    </ul>
</nav>

my relevant Css —

.navList {
  display: flex;
  justify-content: space-between;
  padding-left: 6.82%;
  padding-right: 15.91%;
  margin-bottom: 3.41%;
  height:auto;
  list-style:none;
  font-size: 3.25vw;
  text-style: bold;
  white-space: nowrap;
  background-color: white;
}

/*divs for sticky nav bar*/
nav {
  width: 100%;
  height: auto;
  z-index:500;
}

This marks my first post on stackoverflow, so any guidance provided would be truly appreciated. My goal is to align the navigation bar to match the left and right edges of the header gif I am using (hence the specific padding percentages). Therefore, I believed that utilizing flexbox would be the ideal solution for what I am attempting to achieve.

Thank you in advance for any assistance! (apologies for the limited number of links due to my low reputation)

Sincerely, Em

Answer №1

It seems like the issue here is a lack of using all the required prefixes:

JSfiddle Demo

.navList {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  -ms-flex-pack: justify;
  justify-content: space-between;
  margin-bottom: 3.41%;
  height: auto;
  list-style: none;
  font-size: 2.25vw;
  text-style: bold;
  white-space: nowrap;
  background-color: white;
}
<nav>
  <ul class="navList">
    <li><a href="index.html">Home</a>
    </li>
    <li><a href="mLe_pages/mLe_PORTFOLIO.html">Portfolio</a>
    </li>
    <li><a href="mLe_pages/mLe_ABOUT.html">About</a>
    </li>
    <li><a href="mLe_pages/mLe_BLOG.html">Blog</a>
    </li>
    <li><a href="mLe_pages/mLe_SAMPLE.html">Sample</a>
    </li>
    <li><a href="mLe_pages/mLe_PROJECT.html">Project</a>
    </li>
    <li><a href="mLe_pages/mLe_CONTACT.html">Contact</a>
    </li>
  </ul>
</nav>

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

Information is cleared before it is transmitted

Let's begin with the following code: JavaScript: function keyPressed(e) // function for key press event { if (e.keyCode == 13) // 13 represents the enter key { $(this).val(""); } } $(document).ready(function () { $(' ...

Is it possible to apply CSS based on a component's displayName?

Are you a CSS pro? I'm attempting to apply a class that will make all descendants of an element read-only, but for some reason the style isn't being applied as expected: #ComponentDisplayName * { -webkit-user-select: text; -moz-user-sel ...

strange occurrences of bootstrap.min.css.map popping up

While working on my e-commerce website using Node, Express, Mongoose, and Bootstrap, I encountered an unexpected issue related to "bootstrap.min.css.map". The error 'Cast to ObjectId failed for value "bootstrap.min.css.map" at path "_id" for model " ...

Why is my CSS selector automatically converted to uppercase in Internet Explorer?

I am facing an issue with my CSS file. Here is how it looks: /*mycss.css*/ body { margin: 0px; padding: 0px; } a:link { color: rgb(255, 255, 255); font-weight: normal; text-decoration: underline; } a:visited { color: rgb(255, 255, 255); font-weight: norm ...

Is there a way to dynamically expand and collapse all table rows, with the latest row always remaining visible, using pure JavaScript?

I have a form input field where I enter data. The entered data is then displayed in a table as a new row, with the most recent entry at the top. What I want to achieve is to show only the newest row in the table and hide all other rows. When I hover over ...

What is the best way to ensure a string of words in HTML/CSS wraps to the next line seamlessly?

As I work on creating my portfolio website using Bootstrap and custom CSS, I am running into an issue with the game titles breaking in the middle when displayed. Despite my limited proficiency in English, I tried searching for a solution without success. ...

Conceal overflow in SVG after stroke is applied to top rectangle border

Is there a way to conceal the overflowing red color in this SVG? I attempted repositioning it before the rect with the stroke, but that didn't solve the issue. Check out the code and screenshot below. <br><br> <svg _ngcontent-fdl-c1 ...

The span element remains the same width even with the display property set to flex

How can I center a span element within a container div when the span is preceded by another div? Here's my current code: <div id="container"> <div id="a">A</div> <span id="b">B</span> </div> #container { ...

Steps to deactivate a JavaScript function once the page has undergone a Page.IsPostBack event

My current setup involves a simple div with the display set to none. Upon page load, I use $("#MyDiv").show(); to display the div after a delay, allowing users to enter information into the form and submit it using an asp.net button. After submitting the ...

Arranging containers in a fixed position relative to their original placement

A unique challenge presents itself in the following code. I am attempting to keep panel-right in a fixed position similar to position: relative; however, changing from position: relative to position: fixed causes it to move to the right side while the left ...

Tips for integrating PHP with HTML5 while developing a Blackberry native application that utilizes Blackberry websockets

I'm currently working on a basic HTML5 page that includes inline PHP script. I'm looking for advice on how to transform this app so it can be used with Blackberry WebSockets. For example, I want to develop a native app using HTML5. ...

Navigate to the location using AngularJS elements in the JavaScript iframe1

Dealing with an issue while working on AngularJS. I am facing a frustrating problem where I am attempting to use one link to open links in two separate iframes. All aspects of this function correctly, except for the actual links. The issue arises when usin ...

Using jquery to update the overall quantity of likes

Utilizing jquery, html, and php, I have successfully implemented a like button on my page. However, I am currently facing an issue with displaying the total number of likes without refreshing the page. Upon clicking the like button, the jquery and php scr ...

Learn the method to display a particular post using its unique post ID

I need some help displaying two specific posts by utilizing their post IDs. I'm struggling with the code to retrieve and call these post IDs. Can someone assist me? /////////////////////////////// ////////////////////////////// <div class="foo ...

Triangle-shaped image mapping and interactive hover effects

I am attempting to create a simple hover effect using two triangles. One triangle should start below the other, and upon hovering, it should appear above the first triangle. The problem I am encountering is that the surrounding boxes are obstructing the e ...

Animations with absolute positioning not rendering correctly in Safari

I recently created a basic animation that involves setting an element to "position: absolute" in order to translate it. Everything functions perfectly as intended on Chrome, however, when testing it on Safari, the absolute positioning seems to be completel ...

Is there a way for me to adjust the window's placement?

Currently utilizing Jquery to launch a new Telerik window, as shown below: var win = $('#myWindow').data('tWindow'); win.open(); With the knowledge of the mouse position (x,y), my goal is to initiate the window at that exact location. ...

Challenges Faced When Implementing Dropdown Navigation Bars

Whenever the screen width is less than 576px, I notice that the menu icon on my website shifts its position along with the title (FOOD, LLC). How can I resolve this issue? Website: ...

Converting SQL database tables into MVC webpages using JavaScript

Currently, I am working on populating an MVC webpage by utilizing a Controller and a View using C#, HTML, and Javascript exclusively. It is crucial that I avoid using a model or PHP due to the existing format in use. Thus far, all the data has been succes ...

Is there a way to locate an element within innerHTML using getElementById?

Is it possible to achieve the following code snippet? <div id="parent"> <iframe id="myFrame" title="HEY!" srcdoc="<div id='inner'>Hello World!</div>"></iframe> </div> v ...