Search code examples
htmlcssvue.jspadding

How can I set html and body padding to 0 in Vuejs without affecting bootstrap elements?


I'm creating a bootstrap navbar in my Vuejs project and it's spaced with some left and right margin without adding any body or html padding to 0.

When I go to welcome.blade.php file and set body and html padding to 0 like so:

*{
   padding: 0!important;
 }

Then I get no right and left space on my bootstrap navbar but algo I get no space between elements inside my bootstrap navbar.

I want to set HTML and body padding to 0 without affecting bootstrap element paddings/margins.


Solution

  • If you use * that means all tags and classes,

    You have to use

     body {
       padding: 0 !important;
       margin: 0 !important;
     }