Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

2K
Views
Imagen de fondo de pantalla completa en angular

Uso el siguiente código para establecer una imagen como imagen de fondo en angular. El objetivo es tener la imagen de fondo en pantalla completa sin desplazamiento. Un amigo mío que sabe algo sobre html+css dice que mi código está bien. ¿Quizás la razón es que angular funciona un poco diferente? ¿Tienes una idea de dónde está mi problema? De hecho, la salida es solo una línea con "Hello World" y el fondo solo aparece en esta línea.

aplicación.componente.html

 <html> <head> <title>Hauptmenü</title> </head> <body> <label class="title">Hello World</label> </body>

aplicación.componente.scss

 html { margin: 0px; height: 100%; width: 100%; } body { background-image: url('../assets/background.jpg'); margin: 0px; min-height: 100%; width: 100%; }

aplicación.componente.ts

 import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent { title = 'SeeIT'; ngOnInit(){ } }
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Prueba este CSS:

 html { margin:0px; height:100%; width:100%; background:url('../assets/background.jpg')no-repeat center center fixed; -webkit-background-size:cover; -o-background-size:cover; -moz-background-size:cover; background-size:cover; } body { /*no other attributes required for a full screen background image*/ }

Funciona para mí todo el tiempo.

over 4 years ago · Santiago Trujillo Report

0

Acabo de intentar esto y resulta que tenía que hacer esto:

 <body style="background-image: url(your-image-here); background-size: cover;"> </body>
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!