如何在CSS和JS中创建可滚动/可接触的网格?
我对如何用不确定的列和行制作网格感兴趣,这些列和行可以放入另一个Div中,而不会溢出到其他对象中或与父母大小混乱。
我希望它是正方形的,我正在使用尾风CSS,但我可以适应SCSS或Vanilla CSS。我也希望它在台式机上使用鼠标和触摸功能的设备可接触/可移动。
我将如何实现这一目标?
I'm interested in how I can make a grid with an undetermined amount of columns and rows that I can put inside another div and have it not spill into others objects or mess with the parent size.
I want it to be square and I'm using Tailwind CSS but I can adapt to SCSS or vanilla CSS. Also I want it to be touchable/moveable with a mouse on desktop and touch capable devices.
How would I go about accomplishing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设我已经正确理解了您的问题,这是您可以做到的一种方法。我没有使用触摸设备对其进行测试,但是也不难对其进行修改以响应触摸事件。
Assuming I've understood your question correctly, here is one way you could do it. I haven't tested it with a touch device but it shouldn't be hard to modify it to also respond to touch events.