Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material-UI app bar comes with a margin

I used Material-UI 's AppBar component and it works well, but comes with a margin, anyone got a workaround. I need to get rid of the margin.

like image 530
Rajika Imal Avatar asked Jan 15 '16 19:01

Rajika Imal


People also ask

What is app bar in material UI?

The AppBar component in Material UI is actually just a Paper component with some special CSS properties.

How do you add spacing in material UI?

Use the theme. spacing() helper to create consistent spacing between the elements of your UI.

How do you give a margin in material UI?

To add padding and margin to all React Material-UI components, we can use the Box component. We use Material UI's Box component to add a container with margin and padding. We set the margin on all sides with the m prop and we set the top padding with the pt prop.


1 Answers

If you use default React Web template to create the project, you can edit the index.html file in public folder, add below style in body:

<body style="margin: 0">
...
</body>

Or add it in you css file like below:

body {
    margin: 0;
}
like image 140
Wilson Wu Avatar answered Sep 20 '22 05:09

Wilson Wu