简体   繁体   English

我想让我的盒子偏移,我尝试放置属性但没有任何反应。 我使用 Tailwind 和 React

[英]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">

i want to make it like this: !pic 1 ] 1我想做成这样: !pic 1 ] 1

but i get this:但我明白了: 图 2

Try adding mt-[-50%] instead of -top-28 .尝试添加mt-[-50%]而不是-top-28 Top work with position property like relative and absolute . Top使用 position 属性,如relativeabsolute You can also use -top-28 but you have to add relative or absolute class.您也可以使用-top-28 ,但您必须添加relativeabsolute 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.

相关问题 React.js 中的点击处理程序在事件发生之前执行。 我怎么能阻止呢? - The on click handler in React.js executes before the event happens. How can I stop that? 当我在React / Firebase App中单击我的按钮时没有任何反应 - Nothing happens when I click my button in React/Firebase App 我尝试使用 skulpt 制作 python 解释器,但遇到了意外错误。 我想在我的网站上使用它 - I tried to make a python interpreter using skulpt, but ran into an unexpected error. I want to use it on my website 当我单击复选框时,没有任何反应(提交) - Nothing happens when i click on the tick box (submit) 我想使用 React 制作一个 3D 移动框 - i want to make a 3D moving Box using React 当我尝试向我的网站添加反应时没有任何反应,看起来浏览器没有检测到文件 - Nothing happens when I try and add react to my site, it doesn't look like the browser is detecting the file React 一直在说。map 不是 function 并且我尝试过的没有任何工作? - React keeps saying .map is not a function and nothing I have tried is working? 单击我的Chrome扩展程序后,什么都没有发生 - Nothing happens when I click my chrome extension 当我尝试使用 client.user.setAvatar() 时,没有任何反应 - When I try to use client.user.setAvatar(), nothing happens 我无法让 Tailwind 运行 - 尝试了我所知道的一切 - I cannot get Tailwind to run - tried all that I know
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM