(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

Shifting HTML table in Javascript by toggling checkboxes

When I click the checkbox, the table elements are not displaying inline. I am simply hiding the class "box". Do I need to write a special format? By default, the elements are displayed inline but when I check the checkbox, they shift. The column 'Stat ...

Use CSS to target elements with IDs that have been generated randomly

Unfamiliar with the specific IDs, this markup presents a challenge: #product-20625055 { background-color: #FC0; } #product-66980342 { background-color: #0CF; } #product-54722210 { background-color: #F0C; } <div class="product" id="product-20625055"&g ...

Utilizing several carets in a single or multiple text areas and input boxes

Just a quick question... Can a textbox have two carets simultaneously, or can we have two separate textboxes both focused at the same time? I am aware of simulating this using keydown listeners but I'm specifically looking for visible carets in both ...

Having trouble setting a background image for my CSS button

Recently started experimenting with button styles and I wanted to create a design where there is a background image on the left of the button with text located on the right side of the image. Here's the code snippet I've been working on. Here&apo ...

Transferring live data between AJAX-triggered pop-up windows

Utilizing modals frequently in my application is a common practice. There are instances where I need to transfer data from one modal box to another. For instance: Suppose there is a table listing different car manufacturers (Audi, BMW, Honda, etc). Each r ...

When scrolling back to the top of the page, the data-spy feature does not re-highlight the "Home" anchor

After experimenting with Data-spy to change the active anchor while scrolling, I encountered an issue. Upon scrolling back up to the top of the page from the about section, the "Home" anchor failed to re-activate. How can this be fixed? I attempted to rem ...

Ensure the header remains fixed when scrolling in an HTML page with Bootstrap

I created the following code. However, when I scroll down the table, the header disappears from view. I would like the header to always remain at the top, even when scrolling. Despite searching Google multiple times and trying various solutions, I have no ...

When you hover over them, chips transform their color

I am currently using a chip in my code and I would like to change its color when the mouse hovers over it. I attempted to achieve this by using: hover:{ backgroundColor: 'red', } In addition, I incorporated const StyledChip ...

Tips for customizing the appearance of the react-stripe-checkout form

Could someone please provide guidance on applying custom styles to the react-stripe-checkout form component, such as changing the background color? Visit this link for more information ...

What is the best way to position two divs side by side at the bottom of the

When trying to align my second div with the first one, I face an issue. If the text above the first blue box is longer, the second div appears to be outside the line of the box. Changing the relative position doesn't solve this problem either. When th ...

Observing a web page created by a Java Servlet

After receiving the provided code, I attempted to compile it using a customized version of Dr. Java. However, upon attempting to run the code, I encountered an error message stating: "Static Error: This class does not have a static void main method accepti ...

What can I do to prevent my HTML/CSS/jQuery menu text from shifting when the submenu is opened?

After encountering numerous inquiries regarding the creation of disappearing and reappearing menus, I successfully devised a solution that functions seamlessly on desktop and tablet devices. My approach involved utilizing the jQuery .toggleClass function w ...

Error in Angular 2: The app.component.html file triggered an exception at line 1, character 108 due to excessive recursion

After successfully setting up the Angular 2 quickstart and connecting to an express server, I encountered a problem when switching from using the template property to component templateUrl. I have created a Plunker to showcase this issue: Plunker Demo imp ...

What method can I use to ensure that the sidebar stays fixed at a particular div as the user continues to scroll down the

Is there a way to automatically fix the sidebar once the user scrolls down and hits the top of the .Section2? Currently, I have to manually enter a threshold number which can be problematic due to varying positions across browsers and systems. Fiddle htt ...

The error code 13:5 indicates that the "Home" component has been registered in the Vue application but is not being used, leading to the error message "vue/no-unused-components"

I encountered this issue while working with Vue for the first time. I was attempting to construct a website using Vue/CLI by reorganizing and building from the inside out. However, I am unfamiliar with Vue and unsure how to resolve this error. The changes ...

"Using jQuery to target parent element of a checkbox and apply

Looking to modify the background color of a label based on whether the checkbox inside is checked or unchecked. Please note: Currently, the label's background changes on the first click, but it does not revert back when unchecking the box. <div c ...

How to ensure onmouseenter and onmouseleave work properly in Chrome using HTML, JavaScript, and jQuery

<div style="position: relative; left: 50px; top: 30px; width: 300px; height: 150px; background: #222222;" onmouseenter="this.style.background='#aaaaaa'" onmouseleave="this.style.background='#222222';"></div> http://jsfiddle ...

Using only HTML, I have created a collapsible accordion in Angular without the need for JS code. However, when I click the button, nothing happens. Can you help me resolve

I am attempting to add an Accordion button to my website using the HTML code provided below. I am currently incorporating this in a very basic manner, without any utilization of javascript code, within this example of accordion snippet. When the button i ...

Angular: Excessive mat-menu items causing overflow beyond the page's boundaries

Within my mat-menu, there is a div for each mat-menu item. The number of items varies depending on the data retrieved. However, I noticed that when there are more items than can fit in the menu, it extends beyond the boundaries of the mat-menu instead of ...

What causes a new stacking context to be formed when using position: relative without z-index?

After reading this informative piece: When two elements share the same stack level, their layering is determined by their order in the source code. Elements stacked successively are placed on top of those that came before them. And referencing this ar ...