Eliminating vertical spacing between words with CSS

I am trying to nest a span within a button

<span style="font-size: 11px; font-weight: 700; white-space: normal; margin-left: -5px;">UPGRADE PLAN</span>

When I use white-space: normal, it breaks the word UPGRADE PLAN vertically. However, I am unable to remove the vertical gap between them. You can see the gap between upgrade and plan here. My goal is to achieve no gap between these two words like in this example here. Can anyone provide guidance on how to accomplish this?

Answer №1

To ensure proper alignment, adjust the line height to be smaller than the font size using the code snippet below:

span{
 max-width: 80px;
 display: block;
 text-align: center;
 line-height: 7.5px;
}
<span style="font-size: 10px; font-weight: 600; white-space: normal; margin-left: -3px;">IMPROVE DESIGN</span>

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

Highcharts 3D Pie Chart with Drilldown Feature

How can I create a 3D Pie Chart with Drilldown effect? I am having trouble understanding how it works. Here is a JsFiddle Demo for a 3D Pie Chart: JsFiddle Demo And here is a JsFiddle Demo for a 2D Pie Chart with Drilldown feature: JsFiddle Demo You can ...

I'm attempting to arrange the movieCards in a horizontal row, but they keep stacking up vertically instead

I have created a movie list component with different attributes in the div section to display the cards in a row. However, all the cards are currently aligned in a column. Should I use flex or grid to achieve the desired layout? If so, how can I implement ...

The art of linking JavaScript events

I'm encountering some challenges with linking events together. I've set up an eventListener on a variety of links that, when hovered over, trigger a drop-down menu to appear. Everything is functioning properly, but I also want triangular shapes ...

Ways to swap out an img element with an almost identical gif element while maintaining its precise placement consistently

I am facing an issue in my code where a random element is generated within the body and when clicked, it is replaced with another gif element. I am using offset() to obtain the top and left values of the original image, and then using replaceWith() to swap ...

Exploring the Fusion of Different Styles in Material-UI Using React

I have two different styles that I use in my code. One style is specific to certain components, while the other style is global and used across various components. For example, consider the following file tree: index.tsx -App.tsx -globalConstants.ts In ...

Ways to determine if a textbox is empty and trigger a popup notification with jQuery

I'm having trouble with checking if the textbox is empty in my form. Every time I try to submit, instead of receiving an alert message saying "Firstname is empty," I get a message that says "Please fill out filled." ('#submit').click(func ...

How to display a specific HTML section to a select group of individuals using PHP

I have created a section in HTML that I only want to be visible to individuals whose if($Admin >= 1) condition is met based on my database. However, I am uncertain about how to implement this. This is the current state of my HTML code. !-- ADM SECTIO ...

Constructing a string with specific formatting inside a For loop

I need assistance with formatting a string within my webform. Currently, I have a function that uses a for loop to output each item in my cart. However, I am struggling to include tab spaces and newline characters for better readability. Here is the code s ...

Display text with a hover effect

When I hover over an image, I want to display some text. I managed to make it work, but the text was expanding the size of the card. To solve this issue, I added a display none to the text class. I can't include all the code here, so here's a sn ...

Is there a way to extract a list of words from a designated element using selenium?

I have been trying to scrape the content of this webpage 10 Fast Fingers in order to extract the words that need to be typed into a list. My intention is to then input these words into a text box for typing practice. The code seems to be running fine, but ...

Tips on transferring data from PHP to initialize it in JavaScript?

I need help displaying football fixtures and opening Modals for each game. I am struggling to pass modal data from PHP to JavaScript, causing errors when clicking on some Modals. Can you assist with initializing every Modal at the time of creation? PHP c ...

<span> compared to <figure> and <area>: Understanding the differences

Can someone explain the distinction between 'span' and the latest HTML5 elements 'figure' and 'area'? What is the specific function of each, and when should they be used? For instance, I often utilize a 'span' with ...

Retrieving specific HTML data without the need to download the entire webpage

Is there a way to extract data from an HTML table on a webpage without downloading the entire HTML content? In my Delphi XE2 application, I am using TWebBrowser and TEmbeddedWB to load the webpage and then parse the Table element. However, due to the heav ...

Is there a way to shift the button over to the left?

I am currently utilizing the modalExample provided in the Bootstrap documentation. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">Open modal</button> <di ...

Locate the class identifier within the source SCSS document that is condensed into a unified CSS file when rendered in the browser

In the application I'm working on, the index.html file uses app.css, which is generated from multiple SCSS files. When inspecting an element to find its corresponding CSS, is there a way to determine which SCSS file that style originated from? ...

Enabling a checkbox grid for exclusive rectangular selections

Apologies for the confusing title, I struggled to come up with something more fitting. Let's say my client needs a square area on their homepage where they can upload images that will be placed within various boxes in a grid. The available box optio ...

What's the best way to conceal scrollbars in Nuxt2 whilst preserving one for the description?

The Issue My goal is to remove scrollbars from all pages (which I achieved successfully), but keep one visible for a specific section of description. What I Attempted I tried adding the class .scroller and only displaying it for the <div> containi ...

Is it possible to use both XHTML and HTML in the same webpage?

How can I combine HTML and XHTML on a single page while utilizing JSF and integrating it into a template? ...

Is the alignment of the HTML columns off?

When print-bannertext-left is empty, the print-bannertext-center shifts to the left. How can this issue be resolved? .print-bannertext-left { width: 30%; float: left; } .print-bannertext-center { width: 30%; float: left; margin-bottom: 0.2%; } ...

Error occurred while trying to access a file within the server using $_GET method

Struggling to access a URL within my folder, but encountering an error. I have attempted using file_get_contents without success. Warning: include(/home/vol2_3/*****/*****/htdocs/new/td.php?r=8&ids=309834): failed to open stream: No such file or direct ...