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

133
Vistas
beginner JavaScript background

I am having is trying to have a grey background, but with text over top of it rather than before or after the grey square.

Here is my code, an HTML document with JS and CSS integrated:

    <!DOCTYPE html>
<html>
    <head>
        <style type="text/css">
            /* Change svg background color. */
            .area {
                background-color: #75738a;
          }
        </style>
    
    </head>

    <body>
        <svg width="2000px" height="2000px" class="area">
            <script>
                write("Power up to the top");
            </script>
        </svg>
    
        <script>
            // start game "press any to continue"
            document.addEventListener('keypress', (event) => {


            }, false);
        </script>
    </body>
</html>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Previously, I was drawing a square and expecting to be able to put text on it. I realized instead of setting it to print a square, I needed to set the background image in HTML, and use CSS to center and fullscreen it.

<body>
    <img src="gymbackground.jpg" id="bg" alt="">
<body>

HTML^

<style>
    #bg {
        position: fixed; 
        top: 0; 
        left: 0; 

        /* Preserve aspet ratio */
        min-width: 100%;
        min-height: 100%;
        }
    </style>

CSS within HTML^

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