Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

289
Views
Removing Padding From Body In Nuxt.js

I thought of creating a website with Nuxt.js. I heard that its pretty cool and easy to use. I am having a little knowledge on vue.js but still cant find the solution to this problem:

How will I remove the padding of the body?

I know the default margin/padding is 8px.

I tried following:

  1. Created app.html/idex.html at root and set the style.

  2. Added style in pages/index.vue

  3. Used both margin / padding with !important tag.

But still, cant find solution

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use the head() function in your layout or your page.

<script>
export default {
  head () {
    return {
      bodyAttrs: {
        class: 'reset-body'
      }
    }
  }
}
</script>

<style>
.reset-body {
  margin: 0
}
</style>

Stackblitz: https://stackblitz.com/edit/nuxt-starter-pl9ywp?file=pages%2Findex.vue

Or, if you want to really set it globally via the app.html file it should also work (added to the Stackblitz)

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!