5

I want to place an icon at top right corner inside fieldset. When I use Chrome it looks like this:

enter image description here

But for my surprise Firefox shows the icon lower:

enter image description here

In the example I'm using normalize.css and bootstrap.css.

Anyone know the reason about this strange behavior and is there any workaround without creating different styles for different browsers?

Vangi
  • 586
  • 6
  • 20

1 Answers1

3

It seems this is an actual Firefox bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=942341

A workaround would be to wrap the fieldset with a div and to apply the CSS rule "position: relative" to the wrapper div instead of the fieldset.

fieldset {
  border: none;
}

.wrap {
  position: relative;
}

.abs {
  position: absolute;
  top: 0;
  right: 0;
}
<div class="wrap">
<fieldset>
  <legend>Legend</legend>
  <div class="abs">X</div>
</fieldset>
</div>
lampyridae
  • 949
  • 1
  • 8
  • 21