The icons in my navigation menu appear differently in Safari compared to Firefox

Having some trouble with the vertical alignment of navigation menu icons in Safari and Firefox. Any suggestions on how to fix this issue?

HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<link href="reset.css" rel="stylesheet" type="text/css" />
<link href="about_DELETE.css" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:700' rel='stylesheet' type='text/css'>
</head>

<body>
<div id="navbar">

<div id="logo"></div>
<div class="navbordertop"></div>
<ul>
<span class="menuico"><li><a href="#">Menu</a></li></span>
<span class="menuico2"><li><a href="#">Menu2</a></li></span>
<span class="menuico3"><li><a href="#">Menu3</a></li></span>
<span class="menuico4"><li><a href="#">Menu4</a></li></span>
<span class="menuico5"><li><a href="#">Menu5</a></li></span>
<span class="menuico6"><li><a href="#">Menu6</a></li></span>
<span class="menuico7"><li><a href="#">Menu7</a></li></span>
<span class="menuico8"><li><a href="#">Menu8</a></li></span>
</ul>
</div>
<div id="container"></div>
</body>
</html>
  

CSS

body {
      margin: 0;
  }
  html { 
      background: url("images/site-bg.jpg") repeat scroll 0 50px transparent;
      position: relative;
  }
  #navbar {
      border-bottom: 1px solid #56831b;
      background-color: #8898a2;
      clear: both;
      float: left;
      height: 80px;
      margin: 0 auto 6px;
      width: 100%;
      z-index: 99999;
      position: absolute;
      top: 0;
      margin-bottom: 80px;
  }
  #navbar a {
      text-decoration: none;
      font-family: 'Roboto Condensed', sans-serif;
      font-size: 15px;
      color: #ebfedb;
      text-transform: uppercase;
      padding: 11px 0 8px 0;
  }
  #navbar ul {
      float: right;
      list-style-type:none;
      line-height: 3.333em;
      text-decoration: none;
      display: block;
      margin-right: 95px;
      margin-top: 35px;   
  }
  #navbar li {
      display:inline;
      padding: 15px 15px 9px 20px;
      }
  .menuico li:hover {
      background: url(images/home.png) no-repeat 0 13px;
  }
  .menuico2 li:hover {
      background: url(images/home.png) no-repeat 0 13px;
  }
  .menuico3 li:hover {
      background: url(images/home.png) no-repeat 0 13px;
  }
  .menuico4 li:hover {
      background: url(images/home.png) no-repeat 0 13px;
  }
  .menuico5 li:hover {
      background: url(images/home.png) no-repeat 0 13px;
  }
  .menuico6 li:hover {
      background: url(images/home.png) no-repeat 0 13px;
  }
  .menuico7 li:hover {
      background: url(images/home.png) no-repeat 0 13px;
  }
  .menuico8 li:hover {
      background: url(images/home.png) no-repeat 0 13px;
  }
  #container {
      margin: 80px auto -40px;
      position: relative;
      width: 100%;
      overflow: hidden; 
  }

Answer №1

Consider including display: inline-block in this section:

#navin a {
    background-color: pink;
    color: #EBFEDB;
    font-family: "Helvetica Neue";
    font-size: 15px;
    margin: 0;
    padding: 0;
    text-decoration: none;
    text-transform: uppercase;
    display: inline-block;
}

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

A pair of div elements within one section

Can you explain why the following HTML code uses two divs, one with a class and the other with an ID, instead of just using one of them to assign properties? .header { background-image: url("https://s3.amazonaws.com/codecademy-content/courses/web-101/ ...

Efficient PHP caching solution for optimizing JavaScript and CSS performance

I'm facing a unique challenge that I can't seem to solve through typical Google searches. I'm in the process of consolidating all my javascript and css into separate php files using require_once() to pull in the content. The structure of my ...

When the direction is right-to-left (rtl), the floating labels in Bootstrap slide towards the center

Seeking to implement floating labels in Hebrew using bootstrap v5.2, I encountered a challenge. When switching the direction to rtl and clicking on the input box, the label slides towards the center. Here is my code snippet: <div class="form-f ...

programming for the final radio button text entry

I am struggling with a form that has 5 radio buttons, including an "other" option where users can manually enter text. The issue I'm facing is that the form only returns the manual entry text and not any of the preset radio values. I need it to work f ...

Javascript error: The variable calculator_test has not been defined

Why am I receiving an error message: Uncaught ReferenceError: calculator_test is not defined index.html: <!DOCTYPE html> <html> <body> <p>Click the button</p> <button onclick="calculator_test()">test</button> &l ...

The mobile view does not allow scrolling in the dropdown menu

I recently created a webpage using Bootstrap 4 beta with a dropdown menu in the navbar. While it displays perfectly on my laptop in fullscreen mode, there seems to be an issue when viewed on my iPhone. The dropdown menu only shows 7 out of the 9 links. Is ...

How can I modify the appearance of a slider's range?

I'm struggling with customizing the style of a price slider input range. No matter what I do, the changes don't seem to take effect. Can anyone pinpoint where I may be going wrong? Appreciate any guidance on this! Thank you! <div class=" ...

confirming input

Within the script tag, I need to add code to handle the case of a negative number being entered. I've already implemented code to ensure that the value is a number. <script type="text/javascript> function test_ifInteger(testControl, fieldName) ...

How to use Javascript, HTML5, and AngularJS to display and print a PDF document within a

I have a situation where I need to load a Base64 encoded PDF as a String from my server into JavaScript in my client application which is built using AngularJS and HTML5. The structure of my HTML code is as follows: <div id="printablePdfContainer"> ...

Ensuring the corner link remains at the top when expanding or in mobile mode with mdBootstrap's navbar

I have implemented Material Design Bootstrap on my responsive website. When viewing the website on a large screen, the navbar at the top displays: A link to my brand aligned to the left Two page links A profile dropdown aligned to the right Large scree ...

Top method for customizing w2ui grid appearance

While utilizing the w2ui grid to showcase data in a table, I've found it to be quite effective. However, I'm not entirely happy with the appearance of the table itself. Are there any methods available for styling the table that don't involve ...

The custom HTML menu implementation is causing the jQuery autocomplete to lose its "Select" functionality

Seeking assistance in implementing jQuery autocomplete with a custom drop down menu. I have managed to customize menu items using the data()._renderItem method (which is currently commented out), however, this approach disables the menu "Select" function ...

Is there a way to instruct the code to select between two variables and align their values?

I have encountered a challenge while working on a unit test. The website I am testing is dynamic, causing the CSS Selector and xpath to frequently change. As a solution, I came up with the idea of using both CSS and xpath to retrieve the same text. Curren ...

The fullscreen revolution slider in Wordpress is displaying a small white space below it

Check out my website at: . As I reduce the browser width, a blank space appears below the top revolution slider. I'm struggling to get rid of it. Here's what I've tried so far: .boxedWrap .fullScreenSlider {height: 100%;} .boxedWrap .fu ...

Tooltips experience issues when interacting with elements that do not utilize the :active state

$(function () { $('[data-toggle="tooltip"]').tooltip() }) <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" ...

The beauty of Android Studio: Gradients

While working on my Android Studio project, I designed a UI in Figma that included a rectangle with multiple gradients and a solid color. Now I'm wondering how to recreate this exact rectangle in Android Studio. Here is the CSS code for reference: ba ...

Converting Markup Language to PDF or HTML

Are there any markup languages that work seamlessly with a popular .NET open source project to produce highly customized PDF or HTML documents with precise control over styling and positioning? These documents will consist of a combination of static conte ...

Tips for changing text color using JavaScript when hovering the mouse?

I am working on a website for a snow cone stand and am looking to add a unique effect to their flavor list. I want to create an interactive experience where hovering over a flavor name scales the text and changes its color to match the real fruit. Is the ...

Ways to avoid Parents Click Event from triggering during a Child's (Grandchild's) click event

My parent div has a unique feature where clicking on it reveals one of the child divs, and clicking again toggles the visibility of the child div. Inside this child div, there is a switch toggle that functions as a hidden checkbox. The issue I'm facin ...

Tips for arranging divs in Bootstrap 5 to position one above the other

I have chosen to utilize Bootstrap 5 for my website project with the aim of enhancing its responsiveness on all devices. Specifically, I am seeking a way to ensure that when visitors access the site from a mobile device, the image-containing div appears a ...