[英]I want to make my box offset, I tried putting the property but nothing happens. I use Tailwind & React
this is the code i use in my CallToAction.js, i put -top-28:这是我在 CallToAction.js 中使用的代码,我输入了 -top-28:
<div className="border text-white h-[226px] w-auto mb-[389px] bg-brand-quaternary border-brand-primary rounded-lg place-items-center grid grid-cols-4 -top-28">
Try adding mt-[-50%]
instead of -top-28
.尝试添加mt-[-50%]
而不是-top-28
。 Top
work with position property like relative
and absolute
. Top
使用 position 属性,如relative
和absolute
。 You can also use -top-28
but you have to add relative
or absolute
class.您也可以使用-top-28
,但您必须添加relative
或absolute
class。
Are you sure you need -top-28
?你确定你需要-top-28
吗? Try it without the dash top-28
试试不带破折号的top-28
<div className="border text-white h-[226px] w-auto mb-[389px] bg-brand-quaternary border-brand-primary rounded-lg place-items-center grid grid-cols-4 top-28">
I took if from here- https://tailwindcss.com/docs/top-right-bottom-left#basic-usage我从这里拿走了https://tailwindcss.com/docs/top-right-bottom-left#basic-usage
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.