英文:
Using TailwindCSS to put logo in top left and menu in top right
问题
这是您提供的代码片段,以下是翻译好的部分:
<div className="isolate">
<div className="px-6 pt-6 lg:px-8">
<div>
<nav
className="flex h-9 items-center justify-between"
aria-label="全局"
>
<div
className="flex lg:min-w-0 lg:flex-1"
aria-label="全局"
>
<a href="/" className="-m-1.5 p-1.5">
<span className="sr-only">公司名称</span>
<img
className="h-8"
src="/this-company-logo.png"
alt="公司名称"
/>
</a>
<ul>
<li><a href="">首页</a></li>
<li><a href="">联系</a></li>
</ul>
</div>
</nav>
</div>
</div>
</div>
希望这有助于您理解代码的结构。如果您需要进一步的帮助,请随时提问。
英文:
I have managed to write some Tailwind CSS to put a logo in the top left hand corner of the screen, but now I cant seem to get a menu to render in the top right, this is what I have. Nothing I try seems to work. It just renders right next to the logo image
<div className="isolate">
<div className="px-6 pt-6 lg:px-8">
<div>
<nav
className="flex h-9 items-center justify-between"
aria-label="Global"
>
<div
className="flex lg:min-w-0 lg:flex-1"
aria-label="Global"
>
<a href="/" className="-m-1.5 p-1.5">
<span className="sr-only">This Company Name</span>
<img
className="h-8"
src="/this-company-logo.png"
alt="This Company Name"
/>
</a>
<ul>
<li><a href="">Home</a></li>
<li><a href="">Contact</a></li>
</ul>
</div>
</nav>
</div>
</div>
</div>
答案1
得分: 1
你需要删除这个标签:
...
<div className="flex lg:min-w-0 lg:flex-1" aria-label="Global">
...
</div>
...
英文:
You have to remove this tag:
...
<div className="flex lg:min-w-0 lg:flex-1" aria-label="Global">
...
</div>
...
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论