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
Fullscreen background image in angular

I use the following code to set a picture as background picture in angular. The goal is to have the background image on full screen with no scrolling. A friend of me who knows something about html+css says my code is okay. Maybe the reason is angular works a bit different ?! Do you have an idea where my problem is. In fact the output is just one line with "Hello World" and the background just appears on this line.

app.component.html

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

app.component.scss

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

app.component.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

Try this 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*/
}

It works for me all the time.

over 4 years ago · Santiago Trujillo Report

0

I just attempted this and it turns out I had to do this:

<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!