How to not overwrite components using Tailwindcss?

Asked

Viewed 35 times

0

I created a component Header and when I log it into a component called Home, Header overwrites the h3 and even though I tried to put a display block on each component, it didn’t work

<template>
  <div class="container">
    <Header />
    <div class="flex m-5">
      <h3>Hello</h3>
    </div>
  </div>
</template>

<script>

export default {
  name: 'Home',
  components: {
    Header: () => import('@/components/Header.vue')
  }
}
</script>

Header:

    <template>
          <nav
        class="flex fixed w-full items-center justify-between px-6 h-16 bg-white text-gray-700 border-b border-gray-200 z-10"
      >
            <!-- Etc... -->
        </nav>
</template>

Someone can help me and take away this doubt, I have to use a display block even?

  • By chance you placed position Absolute or Fixed in some element inside the container?

  • Hello, no, I put no!

  • 1

    @Tmoraes @huocsl is right, look, there’s a fixed in his <nav> it makes the position of this tag go up there and it will override everything that does not have position defined. Removing the class Fixed should solve the problem, or... you can add a mb-16 to throw everything under your <nav> (This I think would be better as response the writing will get weird here xD)

  • Oxiii, truth, I ate kkk fly but of qlqr way I set block in my header. Thanks @Pliavi

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.