为什么Next.js Next Link组件在我的项目中不起作用?

ldfqzlk8  于 2023-11-18  发布在  其他
关注(0)|答案(1)|浏览(139)

我下面的nextjs教程和下一个链接是不正确的工作,即使它的工作很好的家伙在教程中.我做了一些测试的链接顶部的第一个链接是可点击的,但之后的每一个其他链接不是.我不知道我在这里做错了什么.任何帮助将是伟大的.

import Link from "next/link";

export default function Home() {
  return (
    <main className="">
      <div className="relative isolate pt-14 dark:bg-gray-900">
        <div
          className="absolute inset-x-0 top-28 transform-gpu overflow-hidden blur-3xl"
          aria-hidden="true"
        >
          <div
            className="relative left-[calc(50%-11rem) aspect-[1155/678] 
          w-[36.125rem]-translate-x1/2 rotate-[30deg] bg-gradient-to-tr 
          from-[#ff80b5] to-[#9089fc] opacity-30 sm:left-[calc(50%-30rem] sm:w-[72.1875rem]"
            style={{
              clipPath:
                "polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)",
            }}
          />
        </div>
        <Link href='/chat'>click me</Link>
        <div className="py-12 sm:py-20 lg:pb-40">
        <Link href='/chat'>click me</Link>
          <div className="mx-auto max-w-7xl px-6 lg:px-8">
            <div className="mx-auto max-w-2xl text-center">
              <h1 className="text-4xl font-bold tracking-tight sm:text-6xl">
                Chat with Anyone, anywhere!
              </h1>
              <p className="mt-6 text-lg leading-8 text-gray-600 dark:text-gray-300">
                You speak your language, they speak their language.{" "}
                <span className="text-indigo-600 dark:text-indigo-300">
                  Let AI handle the translation.
                </span>
              </p>
              <div className="mt-10 flex items-center justify-center gap-x-6">
                <Link href="/chat"
                className="rounded-md bg-indigo-600 px-3.5 py-2.5 text-sm font-semibold text-white dark:text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                >
                  Get started
                </Link>
                <Link className="text-sm font-semibold leading-6 text-gray-900 dark:text-gray-300" href="/pricing">
                  View Pricing <span aria-hidden="true">→</span></Link>
              </div>
            </div>

            <div>

            </div>
          </div>
        </div>
      </div>
    </main>
  );
}

字符串
这是我的代码。

hfwmuf9z

hfwmuf9z1#

我不知道你想创建的UI是什么,但是你的“绝对”定位div有问题。因为所有东西都在这个div下(z索引问题)。也许如果你删除那个绝对div或者改变它的样式就可以了。链接没有问题,有样式问题。

相关问题