Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

358
Visualizações
ForeignObject not displaying in Firefox, but is in Chrome and Edge

I am trying to fix a rendering bug with my program, which currently works perfectly in Chrome and Edge. Firefox does not render the foreignObjects at all

I am using the SVG.js library, which produces the code below for one of my foreignObjects. I have tried a fix from an earlier question, which was to use the css code below to no effect.

<foreignObject width="256" height="66" x="76" y="1113">
<span id="run" xmlns="http://www.w3.org/1999/xhtml">
<button type="button" id="runButton" class="userButtons" style="width:133px;height:65px">RUN</button>
</span>
</foreignObject>
svg {
overflow: visible;
}

If anyone has any ideas I would be very grateful.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Quite likely, your svg doesn't have a explicit height.
Try to add a viewBox and height/width properties:

svg{
  overflow: visible;
  border:1px solid red;
}

.scroll{
  height:900px;
  overflow:auto;
}
<div class="scroll">
  <svg viewBox="0 0 256 66" width="256px" height="66">
 <foreignObject width="256" height="66" x="76" y="500">
    <span id="run" xmlns="http://www.w3.org/1999/xhtml">
    <button type="button" id="runButton" class="userButtons" style="width:133px;height:65px">RUN</button>
    </span>
</foreignObject>
</svg>

</div>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda