Tab indicator modified to match the text's material design

I want the tab indicator to adjust its size based on the text.

For example:

https://i.sstatic.net/a8Y0I.png

https://i.sstatic.net/xniMb.png

Should I use JavaScript for this purpose? I am currently using Angular.

Here is my HTML code:

<div class="row ranking-wrapper">
    <div class="col s12 tab-cor no-pd">
      <ul class="tabs ranking-tabs tabs-fixed-width tabs-icon">
        <li class="tab col s3">
          <a href="#ranking-nivel1">
            <div>
              <i class="material-icons estrela-tabs tabs-icon">star</i>
            </div>
            <div>
              {{NIVEL1}}
            </div>
          </a>
        </li>
         </ul>
      </div>
</div>

And here is my CSS:

.tabs .indicator {
    background-color:#f6a20d;
    height: 5px !important;
} 

.tab-cor{
    background-color: #5c4438;
    border-bottom: 2px solid #f6a20d;
}

.tabs-icon{
    font-size: 10px;
    overflow: hidden;
}

.tabs-icon i {
    display: block;
    margin-top: 5px;
    margin-bottom: -15px;
    font-size: 10px;
}

Answer №1

It is recommended to utilize the line-height property within the a tag:

.navigation a {
    line-height: 30px;
}

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

Discover the xpath of an element while bypassing any internal elements

My HTML structure is quite complex, with numerous tables and divs. Additionally, this structure may change over time. Is there a way to find the XPath while skipping elements in between? <table> <tr> <td> <span>First Na ...

Transferring information submitted in a form to a service using AngularJS

Trying to implement a shopping cart app where I need to pass an object into a service function using Angular. Following advice from another post, but encountering an unprovided error and a strange syntax error on page load. The issues seem to be originatin ...

The .forEach() method in Javascript is not suitable for DOM nodes as they are subject to change during the iteration

Having an issue with moving all DOM elements from one node to another, I initially used this code: div.childNodes.forEach((n) => me.container.appendChild(n)); However, I noticed that only half of the nodes were being copied. It seems that the problem ...

Is it possible to utilize ajax for submitting a form only after it has been validated by the

Currently, I am utilizing a jQuery plugin for validation and incorporating AJAX for form submission. My objective is to submit the form only after successful validation; however, the issue arises where the form gets submitted regardless of the validation o ...

Effective ways to incorporate functions from different modules in AngularJS

Currently, I am enhancing my AngularJS skills by creating a Todo list application. Unfortunately, I am encountering some challenges when it comes to utilizing modules from one another. To elaborate, in my app.js file, I have the following code snippet: v ...

Customize the delete icon margin styles in Material-UI Chip component

Currently, I have implemented the V4 MUI Chip component with a small size and outlined variant, complete with a specified deleteIcon. However, I am encountering difficulties when attempting to override the margin-right property of the deleteIcon due to MUI ...

Ways to fetch a JSON object using JavaScript

Currently, I am in the process of creating an HTML5 mobile application and utilizing jQuery to fetch a JSON file from this URL: . Here is the code snippet I used: var url='http://cin.ufpe.br/~rvcam/favours.json'; $.getJSON(url, function(data, s ...

Tips for simulating JSON import using Jest in TypeScript

When it comes to unit testing in Typescript using Jest, I am looking to mock a .json file. Currently, I have a global mock set up inside my jest.config.js file which works perfectly: 'package.json': '<rootDir>/__tests__/tasks/__mocks ...

What is the purpose of importing a module in app.module.ts? And what specifically happens when importing classes one by one in the

I am interested in creating an Angular form, but I have a question about why we import 'ReactiveFormsModule' in app.module. Additionally, I am curious as to why we need to explicitly import classes like FormControl and FormGroup again in the temp ...

what could be causing the token creation issue in node.js when implementing CSRF protection?

Can you explain why the token is not being created in node js CSRF? I have been using this npm package to generate and verify tokens: https://www.npmjs.com/package/csrf Here is the link to the code sandbox: https://codesandbox.io/s/quizzical-resonance-3y ...

What is the best way to set up jest to generate coverage reports for Selenium tests?

I recently made the switch to using jest for testing my JavaScript project after encountering coverage issues with mocha and chai. While my unit tests are providing coverage data, my Selenium tests are not. I've tried various solutions found in outdat ...

Unable to display Polygon using ReactNativeMaps

Having trouble displaying the polygon correctly on my screen. I suspect it's due to receiving an array of objects from my API. This is the code snippet in question: <MapView.Polygon coordinates={poligonofinale} strokeColor="#000" fillColor= ...

Exporting Data and Utilizing a Steady Data Table

I have incorporated the Fixed Data Grid into my latest project. https://facebook.github.io/fixed-data-table/example-sort.html My goal is to generate csv and pdf reports from the data displayed on the grid. Could you please advise me on how to export gri ...

Modify the text color of the fixed navigation when hovering over specific divs

Sorry if this question has already been asked. I've searched online but haven't come across a satisfactory solution. On my website, I have different background colors - blue and white. The text color in my navigation is mostly white, but I want i ...

The attempt to access a Spring Boot webservice using AngularJS and the GET method resulted in a 500 status error, indicating that the operation

I have successfully developed a webservice using springboot and angularjs to download an excel file from the server to my local machine. The URL is being generated correctly, however, I am encountering a 500 error. Below is the code snippet: My Springboot ...

Implementing a soft transition to intl-tel-input plugin

This tel-input plugin was developed by Jack O'Connor. You can find the plugin here: https://github.com/Bluefieldscom/intl-tel-input I have observed that the flags take approximately one second to download, and I would like to enhance this process wi ...

Create CSS styles for various sections with a minimum height of 100% and include a sticky footer for

Many people have asked about creating a sticky footer and main containers with 100% min-height. But how can I achieve this for multiple sections, ensuring each one has a 100% min-height while still pushing the footer below? Currently, my sections are set ...

Execute the JavaScript [ window:print() ] function once the webpage has finished loading along with any

I am facing an issue with my web page that has around 10 Google Analytics charts. I want to trigger a print dialog box once the page is fully loaded, including all the charts and JavaScript. Currently, the problem is that the print dialog box opens after t ...

Sliding a division using Jquery from the edges of the browser's window

<script> $(function(){ $('#right_image1').hide().delay('10000').fadeIn('5000').animate({right: '0'}, 5000); $('#left_image1').hide().delay('10000').fadeIn('5000').a ...

The controls for the Bootstrap carousel component do not have a clear appearance

Trying to implement a Bootstrap carousel component but facing an issue with the controls not appearing transparent like in the example provided in the Bootstrap documentation. Check out the code snippet: <div class="carousel slide" id="s ...