Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

228
Vistas
CodeMirror styles are not working after decorating the textarea

I have a Nuxtjs/Vuejs application within which I have a textarea related to XML/JSON. After the user provides the values for these textarea they will be decorated with XML/JSON using CodeMirror.

Initially, the textarea will have the height of 78vh and I would like my CodeMirror to have the same height and width after making the beautification and include the horizontal/vertical scroll bar to move if the content exceeds the border.

I tried to add the CSS property like this but it's not working at all and I get the huge scroll bar to my browser rather within textarea.

.CodeMirror{
    height: 78vh;
    position: relative;
    overflow: hidden;
    border: 1px solid black;
}

I also tried adding !important and div > div > div > div > div.CodeMirror { to ensure I am taking parent into consideration but nothing seems to work for me.

Can someone please let me know what I need to do so that my textarea will have same height and width and include a horizontal and vertical scrollbar within itself?

I have added my sample code in the CodeSandBox here: https://codesandbox.io/s/boring-water-g14zd?file=/pages/index.vue

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I added in JS instead of in CSS and that worked for me:

for (const s of document.getElementsByClassName('CodeMirror')) {
        s.style.border = '1px solid black'
      }
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda