2

I need help in setting the background-color of a page to a different color using Host Selector. I tried the example in stackblitz https://stackblitz.com/edit/angular-hknw2a?file=src%2Fapp%2Fapp.component.scss, not sure how to set for the whole page. Thanks in advance.

1
  • Non-standard elements are seen as inline by default as they aren't part of the HTML spec. Commented Apr 30, 2019 at 4:31

1 Answer 1

4

Set width and min-height in Host selector to set background-color for the whole page.

body {
  margin:0px;
}

:host{
  background-color: aquamarine;
  display:block;// comment this tyo have "no background"
  width: 100vw;
  min-height:100px;
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, took time to make some changes in my code and fix. Finally worked with, "width: 100%; min-height:100vh;"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.