Background Images Using the Onsen UI

Asked 1 years ago, Updated 1 years ago, 50 views

I'd like to use the Onsen UI to put an image on the background.

Using CSS in HTML

body{background-image:url("image");
  font-family: 'Open Sans', sans-serif;
}

But it doesn't change

Should I change it using the Onsen UI style sheet?

monaca html onsen-ui

2022-09-30 14:52

1 Answers

Well, I think it's better to edit the CSS of OnsenUI.
Have you touched the Weinre console on IDE?
When you mouse over Element while launching the debug application
You can see the target DOM, so you will know which class to apply to.

Also, the page that OnsenUI displays is the DOM that is on top of the BODY.
So even if I set something to BODY, I can't see it because I can see it on top.

I haven't touched OnsenUI for a while, so I'm not confident about the target, but
I think it was attached to classes like .page and .page__content.

Add from Comments

According to the Onsen UI's V1 and V2, it seems that the background image can be displayed by rewriting the page__background class such as style.css.


2022-09-30 14:52

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.