Firefox Flexbox Inline-Flex Glitch

Seeking assistance with using Flexbox to align an SVG and text within a button. The alignment works perfectly in Chrome and Safari, but Firefox is presenting some challenges.

To see the issue live, check out this Codepen demonstration: Please be aware that I am importing an external CSS sheet from https://github.com/mastastealth/sass-flex-mixin/blob/master/_flex.scss.

http://codepen.io/dominicchapman/pen/EgNgoq

The SCSS code is as follows:

.Button {
  border: 0 none;
    height: 32px;
    padding: 0 16px;
    font-size: 14px;
    background-color: orange;
    color: white;

  .Icon {
        fill: white; 
    }

    &:hover, &:active {
        background: red;
    }
}

.Button__icon {
  @include inline-flex;
  @include align-items(center);
  .Icon {
    margin-right: 11px;
    height:16px;
    width:6px
  }
}

Your help on this matter would be highly appreciated. Thank you in advance.

Answer №1

Firefox presents an issue with fully supporting flexbox in <button> elements.

The child boxes are blockified, resulting in the contents appearing on different lines. However, the button fails to establish a flex formatting context, causing all flex properties to be ignored.

While it would make sense for buttons not to support flexbox, this strange mix of behavior seems nonsensical to me. Despite this, Mozilla developers did not initially see a problem with it.

Fortunately, they have since revisited the issue and reopened bug 984869. However, there has been no active progress on resolving the matter.

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

The background image does not fully extend across the entire space

I am struggling to find the solution to a simple issue on my website, michelleforboe.com. The background image in a div is not covering the entire space as intended. I have tried using calc to set the height of the div, but it seems to be slightly off. A ...

Tips for generating a WhatsApp share link for a specific webpage

Is there a way to generate a share link through WhatsApp using the current URL? Hello, I have a website with multiple social media share buttons like Facebook, Twitter, Pinterest, and email. However, I am looking to replace Pinterest with WhatsApp and Ins ...

Navigating to two separate webpages concurrently in separate frames

I am working on creating a website with frames, where I want to set up a link that opens different pages in two separate frames. Essentially, when you click the link, one page (such as the home page in a .html file) will open in frame 1 on the left side, ...

I only notice certain text after carefully inspecting the elements in Google Chrome

While creating an application on Sitefinity (ASP.NET), I encountered an issue where certain elements, such as button text and labels, were not loading correctly when running the application. However, upon inspecting the element, they appeared to be working ...

resizing problem with images that adapt to different screen sizes

I've been working on creating a responsive website, but I'm having trouble with the resizing of the two background images I added to the header. When I view the site on a mobile device, the header appears squashed. I think this might be because I ...

What is the best way to position a semi-circular donut graph in the center?

I am attempting to showcase a doughnut or semi-circle chart within a materialize card, which is a responsive div element. My goal is to present simple data and utilize the chart as a progress bar. I took inspiration from the example provided in the HighCh ...

Remove a div element with Javascript when a button is clicked

I am working on a project where I need to dynamically add and remove divs from a webpage. These divs contain inner divs, and while the functionality to add new divs is working fine for me, I'm facing some issues with removing them. The code snippet b ...

Is it possible to update the text within a button when hovering over it in Angular?

https://i.sstatic.net/ZhNeM.png https://i.sstatic.net/kb670.png I'm looking to update the text displayed inside a button when hovering over it, similar to the examples in these images. I have already implemented the active state, but now I just need ...

Avoid Scrolling within an iFrame in HTML with the Use of #

I have a menu loading in an iframe with links using # like http://<location>/page.html#part1. When I click inside the iframe, the entire page outside of the iframe scrolls to the location of #. How can I stop this from happening? I only want the me ...

Center-align the content in Material UI Typography by using the variant attribute for the caption

I'm struggling to center the content of my Typography elements with default and caption variants using the align="center" property. The alignment doesn't seem to be working properly, especially for the variant as caption. Here is a snip ...

What is the best way to send an object to Vue Component?

How can I properly call a Vue Component with a data object? The todo-item tag works as expected, but the todo-item2 tag does not produce any output. I was expecting the same result. Here is the HTML code: <div id="app"> <todo-item v-bind:te ...

When hovering over the alternating rows of a table, the shadow effect does not appear

I'm encountering an issue with CSS. I have a table and when hovering on the table's tr, there's a CSS property for box-shadow. The problem is that this box-shadow isn't fully visible for the even rows. https://i.sstatic.net/9uSjO.png ...

Modify the font color within a JavaScript countdown

I'm trying to create a timer that changes the font color of a div with the ID "clear" at the one-minute and two-minute marks. However, I'm having trouble getting it to work properly. var ho1 = document.getElementsByTagName('ho1')[0], ...

The clash of interests between jQuery and Bootstrap

I'm facing a problem with conflicting jQuery and Bootstrap files in my header.php code. Whenever I include the jQuery file before the bootstrap.js file, it causes issues with the tabs on my website where clicking on them does not navigate me to the co ...

A guide on incorporating multiple nested loops within a single table using Vue.js

Is it possible to loop through a multi-nested object collection while still displaying it in the same table? <table v-for="d in transaction.documents"> <tbody> <tr> <th>Document ID:</th> &l ...

Use ajax request to serialize input into HTML value

I implemented a jquery.ajax post request to send data to the server using C#, however, I encountered an error with my code. Here is the code snippet: $(function(){ $('#frmSubmit').on('submit', function(e){ e.preventDefault(); ...

Unlimited rotation feature using Twitter Bootstrap

I am currently working with a carousel using Twitter Bootstrap to display 5 items. Here is an example of what I have set up: <div id="carolsel" class="carousel slide" data-ride="carousel"> <div class="carousel-inner"> <div cl ...

Using nextJS to establish a context within a Server Component and incorporating a new library

I attempted to incorporate Framer Motion into my project, but when I added it, an error occurred. The error message displayed was: TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Fo ...

Tips for resolving issues with the header and scrolling content

I am new to CSS and I understand that it is quite simple: Question: I have a sample HTML page below, and when I scroll the page, the header does not stay fixed in one place. What am I missing here? Please assist. window.onscroll = function() { myFunc ...

Using jQuery to show array elements with unique formatting or separator

Using the jQuery map/get function, I am able to retrieve an array of values from multiple checked checkboxes: $('input[type=checkbox]:checked').map(function(_, el) { return $(el).val(); }).get(); After executing this code, I will get an arr ...