Personalize the spacing between elements in your CSS

I am currently implementing the react-d3-speedometer library to create the gauge chart displayed below. However, I am facing an issue with reducing the gap between the gauge chart and the date. I have tried adjusting padding space, using mt or mb options in the class name, but so far, none of these solutions have worked.

<div className="col-auto mb-3" key={esp.id}>
 <div className="card">
  <h5 className="card-header">X</h5>
   <ReactSpeedometer 
    id={"gauge-chart-" + esp.id}
    fluidWidth={true}
    minValue={0}
    maxValue={40}
    value={32}
    valueFormat={'d'}
    customSegmentStops={[0, 10, 20, 30, 40]}
    segmentColors={['#a3be8c','#ebcb8b', '#d08770', '#bf616a']}
    labelFontSize={'10px'}
    valueTextFontSize={'28px'}
    valueTextFontWeight={'500'}
    paddingHorizontal={17}
    paddingVertical={17}
    currentValueText="#{value}˚C"
    currentValuePlaceholderStyle={"#{value}"}
    textColor={textColor}
    />
    <p className="prog_temp text-secondary mt-1">30/10/2020 10:43:44</p>
    <p className="prog_temp text-info mt-1">Temperature: 33˚C</p>
    <button type="button" className="btn btn-outline-info btn-sm btn-block">Temperature Ajust</button>
    <button type="button" className="btn btn-outline-success btn-sm btn-block">Status Ajust</button>
 </div>
</div>

In my CSS file

.prog_temp {
    text-align: center !important;
}

Are there any other ways, using CSS, that you would recommend to reduce this space?

Click here for more information

Answer №1

When looking to reduce spacing in your text, start by adjusting the margin, padding, and font-size properties within the paragraph tag. Once these are set to zero and you have achieved your desired font size, consider using line-height as a final step.

p
{
  margin:0;
  padding:0;
  font-size:60px;
  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

Image switch on click through thumbnails

I'm currently learning how to create a basic image gallery. The setup consists of a main large image in the center with two smaller thumbnails, one positioned at the top left corner and the other at the bottom right corner. <div class="images_gal ...

Retrieving text content within a span element using CSS

Here is the Jsfiddle that I experimented with http://jsfiddle.net/LpH8B/2/ <span>*</span> <br> <span>*</span> <br> <span>hdhdf</span> span[text='*'] { color:red; } I am looking to target ...

How can JavaScript onClick function receive both the name and value?

My current challenge involves a function designed to disable a group of checkboxes if they are not checked. Originally, this function was set to work onClick(), with one argument being passed from the checkbox element. Now, I need this function to be trigg ...

Bizarre actions with jQuery append in Internet Explorer 8

Issue with adding elements to a div in IE8: The element is not added until the button is clicked twice, resulting in two new elements being added at once. Here's the code snippet in question: $(options.addButton).click(function(event) { var proto ...

How can I transfer user input data from a React.js/Electron application to a Python script?

Currently, I am working on developing a cross-platform user interface using React.JS/Electron to complement this individual's project automation Python script. However, I am encountering difficulties as the Python script requires various details such ...

Transferring the value of a variable from a react constructor to a Node.js backend

Are you able to send variable values from a react constructor to a nodejs backend? The goal is to send specific data to the backend as soon as the page loads in order to execute certain functions on the server side. constructor(props) { super(prop ...

Using jQuery to create a captivating Parallax Effect on your website's background image

Hey there! I have a div with the class 'section' that serves as a key element on my website. It has a background image set using the following CSS: .section-one { width: 100vw; height: 100vh; background-image: url(images/outside-shot ...

Rendering React components on the server, sending the HTML to the client's browser

I'm working on setting up a new application where I want to utilize React server rendering. The versions I'm using are: React 0.14.8, Express 4.13.4. const React = require('react'); const ReactDOMServer = require('react-dom/serve ...

iOS devices experiencing issues with iframe responsiveness

Can someone take a look at this for me? I can't seem to figure out what's missing. I have an iframe with a width that extends beyond the Bootstrap 12 col I placed it in, despite setting up CSS to make it responsive. The site works fine in desktop ...

Avatar hover triggers a popup card

Having trouble with the hover effect on Material UI's Avatar component? I've added a card component that should only display when hovering over the avatar, but it seems to be visible even without hovering. Any help or guidance on how to fix this ...

Error: Attempting to access 'pageContext' property on undefined object, resulting in TypeError while utilizing sp pnp v3

I am currently following a tutorial to build a webpart using SPFX and SP/PNP v3: https://learn.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/use-sp-pnp-js-with-spfx-web-parts I have also consulted: Here is the main .ts file: public async onIn ...

Incorrect viewport widths in Vue Bootstrap fluid containers

I require a container that spans 100% of the available width until it reaches a specific breakpoint (max-width). Upon exploring the official documentation, I came across the responsive fluid container, which appeared to be a suitable choice. Responsive ...

Center a container div with two divs offset from its center

I attempted to place a banner at the top of a webpage, but ran into trouble with positioning two divs correctly. They were not aligning properly (using the same method as a single static div would) and one was appearing below the other. Here is the code: ...

Add a <div> element to a webpage in a random location every time the page is refreshed

I have a variety of 2 types of <div>s displayed on a single page. Collection 1 consists of: <div class="feature">content 1</div> <div class="feature">content 2</div> ...and so forth. Collection 2 consists of: <div class ...

Is there a way to align this button vertically to the bottom of its container with Bootstrap 5?

I'm currently working from this codepen snippet and facing an issue where I can't seem to align the button in the left box to the bottom of the box. Despite trying multiple approaches, I haven't been able to achieve the desired alignment. C ...

Insert this HTML table along with radio buttons into an Excel spreadsheet

My HTML table contains rows with a variety of content, including plain text characters and elements like radio buttons and lists. I want users to be able to copy-paste the table into MS Excel as plain text and have the radio button values replaced with "c ...

Issue with Chrome Browser Border Radius Bug when applied to element with Display: Table

I'm facing an issue with border radius in the Chrome browser. When applying a border-radius to an element styled with dashed border-style and display:table, the background-color exceeds the limit of the border. Here's how it appears in Chrome: ...

Limit the character count for form fields in React Admin

Is it possible to restrict the number of characters a user can input into a field in a SimpleForm component within React-Admin? According to the documentation, React-Admin does not have a built-in feature for limiting character input. Although there is va ...

"Exploring the features of Next.js: static exporting, route management, dynamic routes, and utilizing

TDLR; Is there a better way to achieve successful reload of dynamic routing in a static export of a next.js app (next build && next export) without using getStaticPaths ? While working with create-react-app and react-router, I once had to utilize ...

A versatile HTML5 element that can be placed anywhere on the webpage

I am currently developing a library that assists in dynamically loading design. For example: A.EJS This is the a.ejs file B.EJS <b><%= phoxy.DeferRender('a', {}) %></b> Will be presented as <b><div id="phoxy_defe ...