Even with the available space filled, the buttons in the flex box still retain a small margin

Currently, I am constructing a footer for a mobile device that needs to feature 3 buttons closely aligned with no gaps in between.

The styling for the container is as follows:

.NavBar {
    width: 100vw;
    float: none;
    display: flex;
    height: 3rem;
    overflow: hidden;
    position: fixed;
    bottom: 0;
    z-index: 999;
}

And the button styling is defined like this:

.NavButton {
    align-items: center;
    justify-content: center;
    background-color: #dddddd;
    /* border: 1px solid black; */
    border: none;
    border-radius: 0;
    /* float: left; */
    display: flex;
    flex-direction: column;
    font-size: 1.5rem;
    text-align: center;
    flex-grow: 1;
    margin: none;
    font-family: Montserrat-Regular, Geneva
}

Given that each button has flex-grow: 1, one would expect them to expand and fill the entire screen width.

However, after implementation, a thin padding of about 1 pixel remains visible between each button.

Answer №1

It seems like you're referring to having a 1px margin between each button, rather than padding.

Just a heads up, there is no such thing as margin:none;. You might want to try using margin:0; or margin:0px !important instead. This simple change could potentially resolve your issue.

If that doesn't do the trick (although it should), consider including an asterisk (*) at the beginning of your CSS to reset the padding and margin for all elements on the page.

Here's an example:

*{
    margin: 0px;
    padding: 0px;
}

Please let me know if this solution does the job for you! :)

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

Create a sleek and dynamic navbar effect with Bootstrap 5 by easily hiding or showing it after scrolling

Is there a way to make the Bootstrap navbar hide after scrolling for 300px? I found a code snippet here that hides the navbar on scroll, but it hides immediately. How can I modify it to hide only after scrolling 300px? HTML: <nav class="autohide ...

Switching the color of the nav-link in Bootstrap

Struggling to change the color of my Bootstrap's nav-link to white with no success. Here is my code snippet: <nav class="navbar navbar-light" style="background-color: #5E9DFE;"> <a class="navbar-brand" href=& ...

Maintain fixed positioning even when scrolling beyond the boundaries

Currently, I am facing an issue with keeping a div in an absolute position at the bottom right corner. The problem arises when the content overflows and causes the absolute position to move along with the parent instead of staying fixed. This particular s ...

Is there a substitute for image cropping aside from the CSS clip property?

Looking to create an image gallery where thumbnails are cropped to 150px x 150px, but struggling with non-square rectangular images of various sizes. Adjusting width and height distorts the images. Are there alternative CSS or jQuery options for cropping ...

What is the best way to align <h2> and <img> elements that are set to display as inline-block?

I've been experimenting with aligning h2 and img (icon) elements and although I added display: inline-block, they ended up shifting to the left of the section. Is there a way I can center them instead? HTML: <h2>Coffee</h2> <img src=&q ...

Challenges with creating a contact form using bootstrap modal

I'm facing an issue with a bootstrap modal contact form. It works fine on all browsers except for iPad/Safari. Can anyone help me figure out what's wrong? On iPad, the modal is positioned to the right and down the page instead of in the cente ...

Tips for generating a new div for every iteration:

I am currently using asp.net with c# along with a Master Page. I have been attempting to create a new div for each loop in the while statement in order to customize the design as I desire. Is there a way to achieve this or is there an alternative method th ...

Tips for personalizing the sidebar on your WordPress site and incorporating a collapsible menu feature

Is there a way to customize the sidebar in WordPress so that all the categories and their children are easily accessible? For example, on https://www.w3schools.com, clicking on the header category "HTML" displays all related links in the left sidebar. I&a ...

Is it possible for Skycons to show a duplicate icon?

My current issue involves integrating the JavaScript plugin "Skycons" with the Yahoo weather RSS feed. The problem arises when multiple days have the same weather forecast, as the plugin retrieves icons based on ID rather than class. This prevents me from ...

What is the reason for the presence of additional space below when using x-overflow:hidden?

When I place two spans inside each other and use overflow-x:hidden on the inner span, it results in extra space below the inner span. Why does this happen? <span style="" class="yavbc-color-tip"><span style="">Some text</span></span&g ...

Tips for concealing a div using an article until it is activated by hovering over it

I am looking to incorporate a sleek sliding animation on an article that reveals more information in a div upon mouseover. A great example of this can be seen on where clicking at the top right corner triggers the "Show Modern Dev Ad" feature. Below is m ...

Presentation with multi-directional animations

Curious to know if it's possible to create a unique slideshow that scrolls in multiple directions? The concept is to display various projects when scrolling up and down, and different images within each project when scrolling left and right. Is this i ...

How to target a class with a specific number in CSS selectors

My mobile hybrid application is built with Sencha Touch 2 and requires some customization based on the iOS version it's running on. In my Sass stylesheet, I originally had the following selector: .x-ios-7 { /* add iOS7 customizations here */ } How ...

HTML elements have a delayed rendering process in ReactJS

As I dive into learning ReactJS by creating a ReactJS version of my blog, I encountered an interesting issue while testing Google Page Speed. The recommendation to "prioritize visible content" led me to add a placeholder article with a loading message, lor ...

What is the best way to place a popover above a selected text section?

Imagine a situation where a body of text is present. When a word is highlighted within this text, a popover should appear with a tooltip positioned directly at the highlighted word. Think of it as similar to how a Mac displays definitions of words within ...

Turn off automatic resizing of iframes

I'm currently dealing with a webpage that contains an iframe. The iframe contains quite a bit of data, and every time it loads, its height adjusts to match the content within. Unfortunately, this is causing my page layout to be disrupted. Is there a w ...

Centering two images by stacking them with Bootstrap 5

I'm working on a bootstrap layout with two columns, and I need to achieve a semi-opaque background image that covers the entire column with a dark overlay. This is to create contrast for a logo that will be centered within the column. I've tried ...

What is the process for identifying the properties in the .theme file that contribute to the creation of a specific CSS class in GXT3?

The current information provided by Sencha regarding their Theme Builder is quite limited, focusing only on the basic file structure and syntax details (which includes gradients and functions): My specific issue lies in determining which property to set i ...

Having trouble with CSS Transition functionality not functioning properly

I have set up a temporary page with a two-word message in the h1 tag. The h1 has a CSS3 infinite transition for shadow animation. The shadow is visible on all sides, but it does not transition smoothly. The shadow changes abruptly at regular intervals. I ...

Design: Seeking a layout feature where one cell in a row can be larger than the other cells

To better illustrate my goal, refer to this image: Desired Output <\b> Currently, I'm achieving this: current output Imagine 7 rows of data with two columns each. The issue arises in row 1, column 2 where the control needs to span 5 row ...