Safari browser's innovative navbar stacking feature

I've encountered an issue with my website where the navbar automatically stacks on Safari and IOS devices, but not on other browsers.

My aim is for the navbar to only stack at a specific screen width, and it shouldn't be stacking at all on my computer screen. However, it does when viewed in Safari.

Below is a snippet of my CSS code: Thank you

.Nav {
  background:url(//p2.zdassets.com/hc/theme_assets/521042/200069254/bg-dark.jpg);
  border: 1px solid #ccc;
  border-right: none;
  width: 100%;
  margin-bottom: 0px;
}
.Nav ul {
  margin: 0;
  padding: 0;
}
.Nav ul li {
  list-style: none;
  text-align: center;
  border-left: 1px solid #fff;
  border-right: 1px solid #ccc;
}
.Nav ul li:first-child {
  border-left: none;
}
.Nav ul li a {
  display: block;
  text-decoration: none;
  color: #FFF;
  padding: 10px 0;
}
.Nav ul li a:hover {
  display: block;
  text-decoration: none;
  color: #bec3c6;
  padding: 10px 0;
}
.Nav {
  display: table;
  table-layout: fixed;
}
#Ul {
  display: flex;
  flex-direction: row;
}
#Ul li {
flex-grow: 1;
}
/*To make it Responsive*/

@media (max-width: 330px) {
  
  #Ul {
    display: block;
  }

  .Nav {
    font-size: .8em;
    width:100%;
  }
  
  .Nav ul li {
    display: block;
    border-bottom: 1px solid #ccc;
  }

}

Here is the HTML as well:

<subheader> 
        <div class="Nav">
          <ul id="Ul">
            <li><a href="" target="new">Homepage</a></li>
            <li><a href="">Downloads</a></li>
            <li><a href="">Downloads</a></li>
            <li><a href=""target="new">Help</a></li>
            <li><a href="">Submit a Ticket</a></li>
            <li><a href="" target="new">Contact</a></li>
          </ul>
        </div>
</sidebar>

Answer №1

When it comes to styling with flex, it's important to write your CSS in a way that ensures browser compatibility:

#List {
  display: -webkit-box;      /* For old versions of iOS and Safari */
  display: -moz-box;         /* For older versions of Firefox */
  display: -ms-flexbox;      /* For IE 10 */
  display: -webkit-flex;     /* For Chrome */
  display: flex;             /* For Opera and newer versions of Firefox */
  flex-direction: row;
}

#List item {
  -webkit-box-flex: 1;      /* For old iOS and Safari */
  -moz-box-flex: 1;         /* For older versions of Firefox */
  width: 20%;               /* Adjust for old syntax */
  -webkit-flex: 1;          /* For Chrome */
  -ms-flex: 1;              /* For IE 10 */
  flex: 1;                  /* For Opera and newer versions of Firefox */
}

You can see the code in action here.

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 modify localStorage without having to refresh the page?

I'm currently working on a shopping cart that pulls products from a json-server. So far, I've successfully displayed the products, added the functionality to add items to the cart, and show the quantity. However, I'm facing a roadblock with ...

CSS-only Tooltip: text is getting truncated

I am experimenting with adding tooltips to my forum posts. Short tooltips work fine, but longer ones are causing issues by cutting off text. Changing the position property from relative to absolute fixes this problem, but causes the text to overlap. Here ...

Distorted image display on Bootstrap card in Internet Explorer

My layout includes bootstrap v4 cards, but I'm having issues with distorted images in Internet Explorer 11. It seems that IE is not recognizing the height: auto attribute from the img-fluid class. Should I set a custom height for the card images? Inte ...

I am having trouble getting my website to work offline using caching

My cache file is displayed below: CACHE MANIFEST # 2013-11-22 14:38:54735779 CACHE: ../../../../assets/img/background_01.jpg ../../../../assets/img/background_02.jpg ../../../../assets/img/background_03.jpg ../../../../assets/img/datepicker_icon.png .. ...

Tips on accessing the left value of a absolutely positioned object that transitions on click using getComputedStyle or a similar method

Question: How can I ensure that when the target is clicked, the correct and updated value of the left property is returned? For example, I want it to return 120px if --moved is applied, and 100px if it is not applied. Background: Utilizing getComputedStyl ...

Using Swift, the Facebook SDK redirects to Safari instead of the app

As a newcomer to programming, I'm currently working on an app that involves user registration through Facebook. However, every time I try to log in via Facebook, it redirects me to Safari and then back to the app after logging in. I understand that th ...

Is it possible to use ajax to display the combination of multiple strings?

In my code, I have a span containing some text. By default, the <span class="switcher__result"> has a CSS property of display: none. However, when my <button class="switcher switcher__Last collapsible"> changes the text, the result span switche ...

Converting yard values to meter values using AngularJS: A comprehensive guide

My task is to convert meter values to yard using two dropdowns. The first dropdown contains various values, while the second dropdown has "meter" and "yard" options. If "meter" is selected in the second dropdown, the values in the first dropdown remain unc ...

Is there a way to insert a dot after every two digits in a text field using Javascript upon keypress?

When inputting a 4-digit number (e.g. 1234) in my text field with value format 00.00, I want it to automatically adjust to the 12.34 format. How can I achieve this behavior using JavaScript on keyup event? ...

Turn off dropdown menu animation (JavaScript)

I am trying to completely disable the transition effect on my drop-down menu. Below is the JavaScript code that I believe needs to be changed: function(e) { if ((/input|textarea/i.test(e.target.tagName) ? !(32 === e.which || 27 !== e.which && (40 !== e ...

How can I disable a select element in Laravel 5?

Hey everyone! Currently using Laravel 5 and trying to style the "select" class as "selectpicker". I'm facing an issue where I want to disable or hide the selected option when clicked, as I'm creating a div with the option's content right b ...

Update the contents of a different element upon hover using dynamic PHP functionality

Often, solutions involving the use of java script/jquery to achieve a specific behavior require knowing the exact id of the element. However, in dynamic situations where the id is not always known, it can pose a challenge. In my case, I'm generating a ...

Harvest information using BeautifulSoup and Python

Exploring the world of web scraping with BeautifulSoup in Python, I am interested in extracting the package name and price of each app from the Android Play Store. For retrieving the package name, I implemented the following code : url = "https://play.go ...

Spin (svg, css) in a circular motion from any chosen point, without using the transform-origin property

My goal is to rotate an svg-rect around a specific point without relying on transform-origin, but instead using chained translates and rotation. After conducting some research, I discovered the following method: Translate the rotation point to the origi ...

Tips for positioning the overlay to match the icon list when hovering- JavaScript/Cascading Style Sheets (CSS)

My challenge involves a list of <li>'s accompanied by an icon that, when hovered over, displays an overlay containing information about the 'test'. The setup looks something like this: test1 test2 test3 and so forth.... Here' ...

Revising the hierarchy between !important in CSS and jQuery

(Attempting to modify CSS properties within a Chrome extension content script) Is it feasible to override CSS properties that have been marked as !important on the webpage? For example, if I aim to eliminate an important border: $(".someclass").css(&apo ...

How do I go about transferring a file using PHP?

I'm working on file uploads and saving them in a directory. However, I'm facing an issue: when a file is denied it needs to be deleted from the directory. This part is sorted out. But what if the file is approved? Should I use rename() or move_up ...

Using AJAX to store values from PHP SESSION into form inputs with POST data

Wondering how to store ajax-sent data from form inputs as session variables? I have already included session_start() in header.php. Saving the code in the database is working fine. Here's what I attempted: HTML form <form action='' meth ...

How can Angular JS and HTML5 be used to dynamically create controls?

I have designed a unique project to demonstrate dynamic control creation using angularjs and html5. The project includes an xml file with a set of controls, complete with property and event attributes that can be generated dynamically. Initially, all the ...

Troubleshooting Boostrap Check Box Styling Problem in MVC 5

My registration form has a problem with the checkbox's alignment. I want the text to appear to the left of the checkbox, in line with the placeholders for the input fields on the page. Currently, the text is either above the checkbox (centered in its ...