(CSS) Unusual phantom white outline surrounding menu with no visible border

I've just finished creating my first multi-level drop-down menu, but I'm encountering two white border issues. The first white border appears at the bottom of the menu and seems to be related to the padding of the a-elements. The specific area in the script has been highlighted below.

The second white border surrounds the drop-down menu with languages. Despite trying various alternatives, I haven't been able to find a solution for these problems yet.

Here is a preview of the menu:

#menu-1 {
  position: fixed;
  width: 100%;
  z-index: 999;
  top: 0;
  left: 0;
  box-shadow: 0px 3px 8px -2px rgba(0, 0, 0, 0.4);
}

#menu-1 .top-border {
  background-color: rgb(255, 255, 255);
  padding-top: 1px;
}

#menu-1 .top-border .logo {
  padding: 12px 15px;
  width: auto;
  height: 62px;
  opacity: 0.8;
}

#menu-1 .top-border .contact-info {
  float: right;
  margin-top: 25px;
  margin-right: 12px;
}

.main-navigation {
  width: 100%;
  background-image: url(https://www.translation-services-usa.com/images/quote-admin/main_menu_background.gif);
  background-repeat: repeat-x;
  min-height: 35px;
  padding-bottom: 0;
  height: auto;
}

.menu-item {
  text-transform: uppercase;
  text-shadow: 0 1px 1px #000;
  font-weight: bolder;
}

.main-navigation a {
  font-size: 9.5px;
  letter-spacing: .0625em;
  font-family: Geneva, Arial, Helvetica, sans-serif;
  color: white;
  /* Padding below creates the white border */
  padding: 12px 16px;
  text-decoration: none;
  border-left: 1px solid #146;
  border-right: 1px solid #024;
}

.sub-menu-item a {
  font-size: 11px;
  padding: 10px 13px 10px 13px;
}

.right-arrow {
  display: block;
  content: " ";
  float: right;
  width: 0;
  height: 0;
  border-color: transparent;
  border-left-color: transparent;
  border-style: solid;
  border-width: 4px 0 4px 4px;
  border-left-color: #cccccc;
  position: absolute;
  right: 10px;
  top: 13px;
  margin: 0;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul li {
  display: block;
  position: relative;
  float: left;
}

li ul {
  display: none;
}

ul li a {
  display: block;
  padding: 1em;
  text-decoration: none;
  white-space: nowrap;
  color: #fff;
}

ul li a:hover {
  background: transparent;
  color: #fff;
  background-color: rgba(0, 0, 0, .25);
}

li:hover>ul {
  display: block;
  position: absolute;
  background-color: #035;
}

li:hover li {
  float: none;
}

.sub-menu-1 a {
  color: #eee;
  border-bottom: 1px solid #041e37;
  border-left: 1px solid #002244;
  border-right: 1px solid #002244;
}

.menu-item-2 {
  font-size: 11px!important;
  border-left: none!important;
  border-right: none!important;
  padding-top: 11px!important;
}

.main-navigation li ul li {
  border-top: 0;
}

ul ul ul {
  left: 100%;
  top: 0;
}

ul:before,
ul:after {
  content: " ";
  display: table;
}

ul:after {
  clear: both;
}
<div id="menu-1">

  <div class="top-border">
    <img src="https://upload.wikimedia.org/wikipedia/commons/4/41/SEGA_logo.png" class="logo" alt="Scandinavia">


    <div class="contact-info">
      <img src="http://pluspng.com/img-png/iso-png-iso-png-1000.png" style="height: 37px; width: auto; padding-right: 10px;" alt="Scandinavia">
      <img src="http://pluspng.com/img-png/iso-png-iso-png-1000.png" style="height: 37px; width: auto; padding-right: 8px;" alt="Scandinavia">
      <img src="http://pluspng.com/img-png/iso-png-iso-png-1000.png" style="height: 39px; width: auto;" alt="Scandinavia">
    </div>

  </div>

  <ul class="main-navigation">

Could anyone provide some insights or solutions for this issue? Your help would be greatly appreciated.

Answer №1

Remove the white border around the menu by eliminating the box-shadow

#menu-1 {
  position: fixed;
  width: 100%;
  z-index: 999;
  top: 0;
  left: 0;
  box-shadow: 0px 3px 8px -2px rgba(0, 0, 0, 0.4); //remove box-shadow
}

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

Determine the specific cell involved in an HTML5 drag-and-drop interaction within a table

I've been experimenting with the HTML5 drag and drop functionality in an Angular project. Here's the setup I'm working with: A container containing draggable 'objects' A table where users can drop the dragged elements Following ...

Display loader until the document body has finished loading

Many developers have shared solutions for displaying a loader while an element is being loaded. However, my challenge is unique. I want to display a loader before the document body is fully loaded. The issue arises from an AJAX call in my code: var url = ...

Utilize Flexbox to arrange elements in a grid layout based on specified number of columns and rows

My div is currently empty. <div id="container"></div> I have applied the following styling with CSS: #container{ display: flex; position: relative; flex-flow: row wrap; width: 100%; } The goal is to add more divs to the cont ...

Looking to utilize AngularJS validation in place of the default browser validation?

I am working on a form that contains two ng-forms for input validation. I have encountered two issues with my forms. 1) I am trying to implement a minlength validation for the Company input, but my current approach doesn't seem to be working. How can ...

What techniques can be used to avoid blinking while forcefully scrolling to the left?

In my previous inquiry about dynamically adding and removing divs on scroll, I was unable to find a satisfactory solution among the responses provided. However, I decided to take matters into my own hands and attempted to implement it myself. My approach ...

Troubleshooting on Safari for iOS

As I work on my portfolio website using only HTML 5 without any JavaScript, I encountered an issue with the about page not functioning properly on iPhones. There seems to be a problem with scrolling as some elements are fixed and do not move along with t ...

What methods can be used to modify the appearance of the cursor depending on its position?

Is there a way to change the cursor to a left arrow when on the left half of the screen and switch it to a right arrow when on the right half, using JavaScript? I am trying to achieve something similar to what is shown on this website. I attempted to acco ...

Help with enabling the recognition of backspace key in JavaScript?

My current JavaScript is almost perfect but missing one key element. The form has two fields that are disabled when the user fills it out. <label>Can you drive? </label> <input type="booleam" id="drive" disabled><br> <label>W ...

An issue occurred while trying to retrieve the js file, as an error with code net::ERR_ABORTED 404 (Not

Although this question has been asked before, I am unsure where to find the solution. My express backend server needs to render an HTML page with main.js in it upon launch. app.js code: var createError = require('http-errors'); var express = req ...

Static size element overlapping side panel

I am trying to center a fixed width element on my page, ensuring that it stays centered if it fits within the page width but extends beyond the page if needed with scroll accessibility. I have almost achieved this, but the element overlaps with the sidebar ...

Rails 5 not allow user submission of bootstrap modal form

I am facing an issue with a form inside a modal in my Rails application. When I click on the submit button, nothing happens. How can I use Ajax to submit the modal form and save its content on another page? <button type="button" class="btn btn-primary ...

What is the best way to utilize the features of component A within component B when they exist as separate entities

Component A has all the necessary functionalities, and I want to use it in Component B. The code for ComponentA.ts is extensive, but it's not written in a service. How can I utilize the logic from Component A without using a service, considering both ...

A crisscrossing dashed design running along the edges of the text block

<div class="search"> <p>SEARCH</p> </div> I am attempting to incorporate a dashed lateral padding similar to the one shown in the image, but only on the sides of the text. Is there a method I can use to achieve this effect? ...

Incorporating ajax and jquery into html: Step-by-step guide

Previously, I inquired about implementing a show/hide functionality for a div that only renders when a specific link is clicked. (View the original question) Following some advice, I was provided with jQuery and AJAX code to achieve this: function unhide() ...

What are the steps to achieve the desired PrimeFaces theme appearance for selectOneMenu?

Need help with a JSF Primefaces project using the omega theme. The selectOneMenu dropdowns are not displaying correctly (missing line). Current look: https://i.stack.imgur.com/vF4ms.png Expected look: https://i.stack.imgur.com/hXsIB.png Any suggestion ...

What is the best way to increase the space between table columns in CSS?

I'm struggling to increase the space between the columns in a simple table with two columns. The column-gap property doesn't seem to be working for me. Any suggestions on how I can achieve this? JSFiddle #t td { -webkit-column-g ...

Adding a Bold Headline in Select2: A Quick Guide

I have thoroughly searched through all of the select2 documentation but unfortunately, I could not find any information on how to add bold headlines. Can anyone please provide a full code example (including CSS) on how to accomplish this? ...

What could be the reason for the clone function not duplicating the data within the table

Recently, I utilized jQuery's clone method to duplicate and add an HTML table. The rows and cells of the table were added using jQuery. However, despite using clone, it only replicated the headers and CSS, not the appended data. This raises the ques ...

Creating a new tab within a window that is already open

I have an interesting challenge - I need to open a new tab in a window that was previously opened using window.open(). So, if the window is already open, I want to open a tab in that same window. I have attempted to reference the existing window to open a ...

Employing CSS selectors to target the subsequent element that is accessible

Here is the structure of my HTML: <input type = "checkbox" style = "display:none" id = "select"> <label for = "select" id = 'click'> click </label> <div class = 'next'> </div> I am trying to style t ...