Equalizing the width of the border to match the width of the text

After designing a menu using a website builder with custom CSS, I found that the HTML code generated automatically by the builder needed some tweaking. Upon inspecting the code, I discovered the following structure:

<div class="elementor-container elementor-column-gap-no">
            <div class="elementor-row">
            <div data-id="27de853d" class="elementor-element elementor-element-27de853d elementor-column elementor-col-11 elementor-top-column" data-element_type="column">
        <div class="elementor-column-wrap">
                <div class="elementor-widget-wrap">
                    </div>
        </div>
    </div>
            <div data-id="52e1a94f" class="elementor-element elementor-element-52e1a94f elementor-column elementor-col-11 elementor-top-column" data-element_type="column">
        <div class="elementor-column-wrap">
                <div class="elementor-widget-wrap">
                    </div>
        </div>
    </div>
            ... (more elements here)
                    </div>
        </div>

#menuu {
  text-decoration: none;
  color: #0B1B70;
  -webkit-transition: border 200ms ease-out;
  -moz-transition: border 200ms ease-out;
  -o-transition: border 200ms ease-out;
  transition: border 200ms ease-out;
  border-bottom: 1px solid transparent;
  border-top: 1px solid transparent;
  padding: 3px 0;
  height: 30px
}

#menuu:hover,
#menuu:focus,
#menuu:active {
  border-bottom: 2px solid #61f6ff;
  border-top: 2px solid #61f6ff;
}

.active {
  border-bottom: 2px solid #61f6ff !important;
  border-top: 2px solid #61f6ff !important;
}

I encountered an issue where the text length was affecting the border width, causing it to extend longer than necessary. How can I adjust this using CSS without interfering with the menu functionality? I attempted using inline block, but it caused disruptions to the menu behavior.

For reference, visit this page:

Answer №1

If your goal is to have your menu width automatically adjust to the content, consider using inline-block.

display: inline-block

If this suggestion does not resolve the issue, feel free to share your HTML code for further assistance.

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

Displaying minute scale from right to left using jQuery technology

I successfully created a minute scale that is functioning well, but now I am encountering an issue with displaying my scale. Instead of being oriented left to right, I would like it to be displayed from right to left. Can anyone suggest what might be wron ...

Using Thymeleaf to display <TR> elements according to specific conditions

Is there a cleaner way to show content only if one object is not null? No annotations found in this block of code. Here is the template: <div th:if="${currentSkills != null}"> <tr ><!-- Data File --> <td class="col_id"> ...

Arranging text within a td cell

This is what I currently have: <tr> <td colspan="4" style="font-size:7pt; font-color:red; font-weight: bold;"> PLEASE NOTE: SPECIFY THE ARTICLE IN AS MUCH DETAIL AS POSSIBLE </td> </tr> However, the text does not a ...

Can ChatGPT Service Error be resolved?

I tried using chatGPT to help me with my HTML code, but every time I opened it I received an error message saying "Failed to get service" Here is the code that I want to make work: <html> <head></head> <body> <script& ...

How can I retrieve the attribute value in a JSP request using jQuery AJAX?

On my website, I have a servlet page and a JSP page. JSP: $.ajax({ url: window.location.href + "?b=b", success:function(data){ //doSomething(data); console.info('$ ...

Issue: AngularJS not refreshing view after receiving server response

Currently, as I work on developing a mobile application, I've come across an issue related to relaying messages in the view after executing an ajax call and receiving data from the server. My goal is to display these messages to users only after they ...

Collect form input data containing a binary image and showcase it in a view using webapi

I am currently working on a webapi project using MVC architecture. The project involves converting a jpg image to binary data, sending it to a SQL server, and then retrieving the form data along with the image back as a jpg for display on the view. Althoug ...

I am unable to incorporate added height into the component

In my current project using react.js, material-ui, and sass, I had the task of creating a ChatBit component. After writing it, here is the code: customComponent.js file. // @flow import * as React from 'react'; import { useState } f ...

Display Button Information in InfoPath Form

In InfoPath 2010, I created a form and published it to a SharePoint 2010 list. The end user wants to print this form for their records, but when using the web part to print the screen, the page comes out very small and unusable. Is there any HTML code th ...

Dynamic jQuery URL truncater

Is there an on-the-fly URL shortener similar to Tweetdeck available? I have come across several jQuery and JavaScript plugins that can shorten a URL through services like bit.ly when a button is clicked. However, I am looking for one that shortens URLs aut ...

Determining the height of a Bootstrap column in relation to another element

Utilizing the grid layout from bootstrap, I have the following structure: <div id="prof_cont_enclose"> <div class="row"> <div class="prof_cont_row"> <div class="col-xs-12 col-sm-4 col-md-2 col-lg-2 prof_elem"&g ...

Using dynamic variables in the $.getJSON function

This specific inquiry represents my current goal, with an added layer of complexity. My aim is to streamline the process by creating a single 'fetchData' function in my VueJS project that can retrieve multiple JSON files without duplicating code ...

Use jQuery.ajax() to submit data in separate rows of a table

At the moment, I have no issues submitting my form as long as it contains only one row in the table. However, when I add a second row, an error occurs and the submission fails. My goal is to be able to post the data from each table row separately with just ...

How to access a particular tab in Bootstrap 5 using an external link

Is there a way to direct users to a specific tab upon clicking a link on another page? Check out the example below: <div class="products-btn"> <a href="products.html#pills-profile">view all</a> </div> On Pro ...

In passing the uploader file and form field value to a single action in ASP.NET MVC, you can efficiently handle data transfer

My issue is with passing values from a form and an uploader (using PLUploader). I want the user to fill out textboxes and select an image using PLUploader. When they click on the submit button, I need to pass both the image and the textbox values to one ac ...

Guide on creating my inaugural HTML embeddable widget?

A client recently requested me to create a JavaScript (MooTools)/HTML/CSS/PHP based game as a deployable widget. This will be my first time developing a widget, so I am seeking advice and insights to help me navigate any potential challenges from experie ...

Live AJAX inquiries in progress

Is there a way to track the number of active AJAX requests in jQuery, Mootools, or another library similar to Prototype's Ajax.activeRequestCount? I am looking for a method that can be used across different libraries or directly through XMLHttpRequest ...

Creating a full-width menu with Material UI - a step-by-step guide

I am currently working on creating a mobile menu that spans the full width of the screen. Despite my efforts, it seems like I might be misunderstanding something as my CSS rules are not being applied correctly. Here is a live code example for reference: ...

Utilizing Angular's directive-based *ngIf syntax instead of passing a string parameter

Currently, I'm studying the article on reactive forms by PluralSight to brush up on my knowledge and I'm having trouble understanding the syntax provided below. <div *ngIf courseForm.get('courseName').valid && courseForm.get ...

How to make sure a function in jQuery only runs once

When mySepsisTimer, a simple countdown timer, is initiated once certain selection criteria (sepsis-six-sirs) are met, an issue arises if a user clicks on another option select after the timer has started, causing a duplicate clock to run. How can I ensur ...