Using the `display: inline-block` property will generate a horizontal line at the bottom of the

While working on developing a website to showcase the services of a company, I encountered an unexpected issue. When coding another section of the site, a strange bar appeared on my second menu for selecting categories. It's driving me crazy!

You can view the page here

<div class="menu2">
<div class="aux_960">
    <ul>
        <li><a href="#">saf</a></li>
        <li><a href="#">saf</a></li>
        <li><a href="#">saf</a></li>
    </ul>
</div>

The issue seems to be related to the :after pseudo-element of the li tag in the second menu with three "saf" links at the bottom.

I've tried various solutions but nothing seems to work. The only thing that removed the bar was setting the li positioning to float:left, but it doesn't feel like the right approach.

In the jsfiddle link provided, the images may not show up, but you should still be able to see the bar issue.

Thank you for any help or advice!

Answer №1

The issue you are experiencing stems from

.menu2 {
    display: block;
    line-height: 50px;
    font-weight: 700;
    text-decoration: underline;
}

To resolve this, simply remove the text-decoration: underline;

This specific block of code is located further down in your existing codebase. It appears that there are two definitions of .menu2, and the problematic one is the second.

For a live demonstration, please refer to http://jsfiddle.net/9Xm8k/8/

To implement the fix in your original code, visit http://jsfiddle.net/9Xm8k/9/

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

Styling a horizontal navigation bar with CSS: Using list items (`li`) versus div elements (`div`)

Is it more semantically correct to float li elements within a ul, or should we opt for floating divs inside an external 'outer' div? ...

Guide to pre-populate a text field within a WKWebView on a website with the use of Swift

I am a beginner in the world of coding, specifically with Swift. My goal is to allow users to input their username and password in the settings section, which will then automatically populate the login page on a WKWebView that I have created. Currently, I ...

Arranging the Burgers on the Menu using Flexbox

I'm looking to develop a simple note-taking app, but I'm struggling to figure out how to place a burger menu on the right side of a flexbox. Below are my JS and CSS files: JavaScript / HTML <div className={styles.wrapper}> < ...

Select2 is not displaying correctly as expected

I followed the instructions on to set up a Select2 select. However, I noticed that my Select2 select doesn't look great. Here is how it currently appears: https://i.sstatic.net/SIv7L.png When I don't transform it with jQuery $('#users&apos ...

Diverse Browser Outcomes with jQuery CSS

Currently, I am in the process of developing an app that utilizes percentages as offset positions for ease of calculation. For a visual example, you can visit this link: http://jsfiddle.net/WeC9q/1/embedded/result/ Although the zooming feature functions ...

What causes certain properties of html and body elements to behave in this way?

I'm on a quest for understanding some mysteries. First riddle: Why does the body have a mysterious margin-top? html { height: 100%; background-color: red; } body { height: 100%; margin: 0; background-color: yellow; } <h1>Hello P ...

Excessive Margins in Bootstrap on Mobile Devices

After attempting to create a webpage using Bootstrap 3.3.6, everything looked good on my laptop. However, when I tried to view it on mobile devices using Chrome and other browsers, there was a significant offset issue. Current situation: https://i.sstati ...

The changing of colors does not function properly when clicked in JavaScript

I am having an issue with a drop-down list that offers two options: blue and green. When I select blue and click on the text input field, its background color alternates between blue and black (the default text field color). The same applies when I choose ...

What are the key steps in evaluating a grid layout design?

I recently heard that some designs do not support grid system layouts like Bootstrap or Foundation. This has left me unsure about what elements to analyze in a design before starting work on it. I know Bootstrap uses a 12-column grid system, but I am unc ...

The image fails to display correctly

As I work on creating a basic webpage in HTML and JavaScript, my goal is to validate certain parameters (such as width, height) of an image that users upload via a form. In JavaScript, I extract the file from the form and attempt to display it as an image ...

JavaFX Animation for Charting

My FXML file contains a JavaFX AreaChart <AreaChart id="myAreaChart" onMouseClicked="#handleAreaChartMouseClicked" GridPane.columnIndex="0" GridPane.rowIndex="0" fx:id="myAreaChart" > <xAxis> <Nu ...

Exploring the dimensions of checkboxes in Fluent UI Northstar

Is there a specific method for controlling the size of checkboxes in Fluent UI Northstar? My attempts to modify the font size and height have only impacted the label, not the checkbox itself. Unfortunately, I couldn't find any guidance on this in the ...

Setting specific variables in an array with corresponding key-value pairs

I need help with extracting specific columns from a table that has 5 columns. The columns in question are: column1, user_id, column3, column4, and user_exp. Let's say I have the following select query: $mat_sql = mysql_query( "SELECT * FROM users ...

What is the best way to insert a new row into a table upon clicking a button with Javascript?

Hi everyone, I'm facing an issue with my code. Whenever I click on "Add Product", I want a new row with the same fields to be added. However, it's not working as expected when I run the code. Below is the HTML: <table class="table" id="conci ...

Accessing HTML files locally in an offline web application: A step-by-step guide

I am currently in the process of developing a mobile web-based game. My goal is to implement a single-page design that can be accessed offline. I am looking to organize and store various HTML pages as files within a designated folder, and load them into a ...

Personalized design options for ASP text fields

I have two textboxes (asp:TextBox) close to each other, currently styled like this: https://i.sstatic.net/mcha5.png I want to remove the shadow effect on the top and left edges of the textboxes to apply custom styling. However, using box-shadow has no im ...

Revamping the website to become a Progressive Web App

I am in the process of transforming my website into a Progressive Web App (PWA) and have made some updates to my code to facilitate this: index.html <script> if('serviceWorker' in navigator) { navigator.serviceWorker.registe ...

What is causing images to stretch unnecessarily in Flexbox on IE11?

I am encountering a problem with flexbox on IE11, and despite being aware of the numerous known issues, I am unable to find a solution... <div class="latest-posts"> <article class="post-grid"> <img src="http://lorempixel.com/ima ...

What is the best way to reveal a hidden div using JavaScript after a form submission?

jQuery is not a language I am very familiar with, but I am attempting to display a simple animated gif when a form is submitted. When users click 'submit' to upload an image, I want the gif to show to indicate that the image is being uploaded. Th ...

Learn how you can efficiently send a JSON response to an AJAX call by utilizing a serialized object along with HTML generated from the Html

Using C# and MVC, I am working on responding to an ajax call triggered by Jquery. My goal is to send back an object that includes a List<int> as well as some HTML code generated using a HtmlHelperExtension that I developed. Previously, I was only se ...