Skip to content

Styling the body element #616

Answered by saicu
bistace asked this question in Q&A
Nov 8, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

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

body, #main {
        margin: "0px",
        padding: "0px",
        background-color: "blue",
}

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

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@bistace
Comment options

Answer selected by bistace
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants