Unable to Remove Border From Image Link in Chrome and Firefox (Works in IE8)

I have implemented a jQuery menu on a Master page, where the menu structure is created using an Unordered List. Each list item contains an anchor tag which includes an image tag and a couple of spans.

The functionality of the menu is such that only text is visible initially (without any borders or background colors), and when you hover over a list item, the image and spans expand and become visible. Everything works perfectly in IE8, but when testing in Chrome or Firefox, each list item displays with a thin gray border. While this is acceptable, it's not the desired effect I want to achieve. I suspect this issue is related to the anchor tag, as none of the standard CSS techniques are resolving it. I even tried removing the anchor tag from one list item, and the border disappeared, but unfortunately, I need the hyperlink there. The img tags have valid src attributes pointing to the correct images. In the CSS defined within the HEAD section of the site.master page, I've set the following attributes for "a", "a img" and "a span":

text-decoration:none;
border-style:none;
border:none; 
outline:none;

I also attempted adding `border="0"` directly to the IMG tag, but to no avail. The only time the border disappears is when the anchor tags are removed entirely.

I'm currently stuck on this issue and would greatly appreciate any help!

To provide clarity, here is an example of what one of the menu items looks like in code:

<ul id="sdt_menu" class="sdt_menu">
    <li>
        <a href="#">
            <img src="images/1.jpg" border="0" alt=""/>
            <span class="sdt_active"></span>
            <span class="sdt_wrap">
                <span class="sdt_link">the island</span>
                <span class="sdt_descr">About</span>
            </span>
        </a>
        <div class="sdt_box">
            <a href="#">Airlines</a>
            <a href="#">Travel Info</a>
            <a href="#">Currency</a>
        </div>
    </li>

Below is the Style Sheet used:

ul.sdt_menu {
    position: absolute;
    top: 148px;
    margin:0;
    padding:0;
    list-style: none;
    font-family:"Myriad Pro", "Trebuchet MS", sans-serif;
    font-size:14px;
    width:968px;
    border: 0px;
}
ul.sdt_menu a{
    text-decoration:none;
    outline:none;
    border: 0px;
}
/* Remaining style definitions */

Answer №1

Appreciate you sharing the stylesheet. The subtle gray "border" that's appearing is a result of this specific rule:

ul.sdt_menu li > a {
  -moz-box-shadow:0px 0px 2px #000 inset;
  -webkit-box-shadow:0px 0px 2px #000 inset;
  box-shadow:0px 0px 2px #000 inset;
}

Based on http://msdn.microsoft.com/en-us/library/cc351024%28v=vs.85%29.aspx, it appears that IE didn't introduce support for box-shadow until IE9, hence why it's not visible in IE8.

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

CSS selector targeting an element based on the value of its table border

Is there a way to target a table on a webpage using a CSS selector? The table structure looks like this: <table border="1" width="560" cellspacing="0"> <tr> <td height="28" colspan="3" bgcolor="#FFFFF...> </tr> </table ...

Issue with a input element having relative positioning within a flexbox

Objective: Aim to align the middle DIV (MIDDLE) within a flexbox row in the center. Issue: The right element includes an input element with relative positioning. Consequently, the middle DIV element (MIDDLE) is no longer centered but instead shifted to th ...

What is the best way to center the content vertically within flex items?

I am working with a flexbox header that has two child flex items, each with their own children. Is there a way to change the vertical alignment of the flex items so that their children are aligned at the bottom? div.flexbox { display: flex; align ...

Issues with CSS transitions not functioning properly following the use of toggleClass()

I recently implemented a toggle-menu feature, which you can see in action on this demo. To enhance the toggle-menu, I added a CSS transition effect to div.nav-menu, utilizing max-height:0; and increasing it to max-height:480px;. However, after clicking t ...

Change the toolbar's background color to a solid white, with no gradiation

CKEDITOR.replace( 'editor_1', { toolbar: [ { ..... }, ], uiColor: 'white', }); Unfortunately, the above code does not yield the desired outcome. .cke_top{background-color: white;} It appears that the specified CSS ...

Why is Google flagging my website as not mobile-friendly?

I have developed a website using Next.js with responsive design implemented through Bootstrap and a touch of SCSS. The site displays perfectly on my Samsung S8 phone and other devices, but Google warns me that the text is too small, buttons are not prope ...

The HTML button functions correctly on Windows browsers but experiences issues on Android devices

Explore some delicious minty black tea blends here! After clicking on the "Add to Cart" buttons for various quantities, a confirmation message pops up indicating that the product has been successfully added to the cart. An issue arises when attempting to ...

Creating a copy of a div using jQuery's Clone method

I need help figuring out how to clone a div without copying its value. I've attempted various methods, but they all seem to include the value in the cloned element. This is the jQuery function I am currently using: $('#add_more').click(fu ...

Slider displays images generated by PHP in a horizontal motion

Currently, I am in the process of creating a custom horizontal slider for my client's personalized gallery. The gallery comprises elements displayed as a no-wrap, multi-window-width block, designed to change its margin-left when the slider arrows are ...

The nested elements are not triggering the jQuery on click function

When I attempt to retrieve the attributes of the parent element from a clicked element, I run into issues with dynamically added elements via jQuery. Below is the code snippet for the click event that is not functioning as expected: $("body").on('cli ...

Repairing my CSS with jQuery fullpage.js

My CSS on needs fixing. The word Obert is not aligning properly in the section. Interestingly, everything works fine without Javascript: I suspect the wrapper divs created by the plugin are causing the issue. Can someone lend a hand, please? ...

Modify the style of a div using my JavaScript code

Looking for assistance in updating my code to meet my requirements. Here is what I am looking for: You can find my full code here: http://jsfiddle.net/2urmku1h/ Specifically, I need to make a change to this section: <div style="display:none;">Chan ...

Issue with accessing hamburger menu on Bootstrap site

I recently added a navigation bar to my website using the BootStrap documentation. However, when I switch to the mobile version and click on the hamburger menu, nothing happens. Below is the code snippet for reference: <nav class="navbar navbar-expand- ...

Utilizing mobile emulators to optimize the viewport for mobile application development

Are mobile emulators like MITE() able to detect viewport settings? <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> Can anyone recommend a mobile emulator that does recognize viewport settin ...

Adding and sorting div elements from an external HTML file

Greetings everyone, I have recently delved into the world of coding and am currently working on a project for my course to streamline access to information and data in my daily life. So far, I have created a single HTML file and two additional external HT ...

Is your display:inline-block feature not functioning properly?

I am currently designing the homepage for this website and I am attempting to arrange the category divs under the header in a grid layout, with 3 divs per row. I have been trying to achieve this using display:inline-block, but so far, I can only get the d ...

Having trouble aligning my slider in the center

Despite trying various methods to center this slider, such as using align="center" and different margin styles on the images and slider div itself, I am still facing alignment issues. Any assistance would be greatly appreciated. This is my first time posti ...

Cut off a string from the start

I'm using the text-overflow: ellipsis property in a div to shorten lengthy text values. Since there is no white space in the URL, I want to prevent the overflow from increasing the width of the div. What I want to achieve is to display the following: ...

Adjusting the placement of a div based on the height of a table

I recently created a dynamic table where rows are inserted dynamically. One issue I am facing is that when the table height increases due to more rows, a div below the table does not show up in the desired position. How can I set the position of the div so ...

Issue with flex-grow property not functioning as expected in Internet Explorer 11

Hello! I'm running into an issue with flexbox in Internet Explorer: http://jsfiddle.net/EvvBH/ I've noticed that the #two element has flex: auto, which is meant to make it expand to fill the container, even if there's limited content. Ho ...