My fieldset has a legend containing text and a button. I am attempting to use flexbox to right-align the button within the legend. This setup works correctly in Chrome, but encounters issues in Firefox.
I have managed to replicate the problem with a simplified code snippet:
main {
width: 100%;
}
fieldset legend {
display: flex;
justify-content: space-between;
width: 100%;
}
<main>
<fieldset>
<legend>
Legend text
<button type="button">
Button text
</button>
</legend>
</fieldset>
</main>
In Chrome, both elements inside the legend are displayed on the same line as intended:
https://i.stack.imgur.com/Gm03K.png
However, when viewing the page in Firefox, the layout is not displaying as expected. Here is how it looks: https://i.stack.imgur.com/dh3Su.png