-
Hello, I'm new to Dioxus so it's probably a silly question but I searched in the docs and in the book and could not find an answer. Basically, I would like to create a div that fills the entire screen so I would need to have something like this on the body element: margin: 0
padding: 0 Doing this did not work, could you please show me the way to do it? rsx! {
body {
margin: "0px",
padding: "0px",
background_color: "blue",
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
If you're using the dioxus-cli, you can just add a CSS file to the config, see this example: https://github.com/DioxusLabs/docsite/blob/master/Dioxus.toml#L31 Then you can style the body in that file.
Just make sure its accessible through the static asset dir, configured here: https://github.com/DioxusLabs/docsite/blob/master/Dioxus.toml#L15 Also, you may need to style the |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
If you're using the dioxus-cli, you can just add a CSS file to the config, see this example: https://github.com/DioxusLabs/docsite/blob/master/Dioxus.toml#L31
E.g
style = ["/custom.css"]
)Then you can style the body in that file.
public/custom.css
Just make sure its accessible through the static asset dir, configured here: https://github.com/DioxusLabs/docsite/blob/master/Dioxus.toml#L15
Also, you may need to style the
<div id="main"></div>
as well, removing its margin/padding