簡體   English   中英

我的 tailwindcss 沒有按我的意願工作,即我的 Text2 放置不正確

[英]My tailwindcss is not working as I want i.e my Text2 is not well placed

我想把我的文字: Text2放在右側。 我的Text1放置得很好。 請問我要改什么? 有了我所擁有的,我的Text2就在Text1旁邊

 <div className="w-screen h-screen flex">... <div className="flex-1 h-full flex flex-col">... <div className="flex-1 flex flex-col bg-primary-500/5 dark:bg-red-400 overflow-y-auto">... <div className="shrink-0 h-10 text-sm text-gray-700 bg-white dark:bg-slate-900 px-5 flex items-center"> Text1 <div className='flex-1'> Text2 </div> </div> </div> </div> </div>

試試這個例子。 我向Text2添加了兩個屬性以向右側偏移。

 <div class="flex-1 flex justify-end">Text2</div>

 <script src="https://cdn.tailwindcss.com"></script> <div class="w-screen h-screen flex">... <div class="flex-1 h-full flex flex-col">... <div class="flex-1 flex flex-col bg-primary-500/5 dark:bg-red-400 overflow-y-auto">... <div class="shrink-0 h-10 text-sm text-gray-700 bg-white dark:bg-slate-900 px-5 flex items-center text-white"> Text1 <div class="flex-1 flex justify-end">Text2</div> </div> </div> </div> </div>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM