<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 5 年前。
标签 javascript css reactjs
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 5 年前。
我有一个渲染多个微调器的元素,我注意到在重新加载时只有最后一个微调器在旋转。所有元素都使用 :before
。
我知道这可以通过删除 css 中的 :before
来解决,但我想知道为什么会这样。
这是示例,您会看到所有微调器都已加载,然后当您单击“重新加载”文本时,只有最后一个微调器会旋转。
最佳答案
问题是您在 .spinner
类上设置了 before
。
将其设置在 .spinner-container
类上,它将按预期工作
Reach 在堆栈片段中不起作用。这就是为什么我添加了一个 js fiddle
关于javascript - :before only working on last element,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45883354/
相关文章:
php - 我有一个联系表,在适合移动设备的 css 样式上,它不允许我输入数据
javascript - 如何从鼠标单击坐标获取 WebGL 3d 空间中的对象
javascript - 通过javascript设置背景位置
javascript - 如何使导航栏最初隐藏在 Bootstrap 中
twitter-bootstrap - 在react-bootstrap中处理点击 `ButtonGroup`
javascript - 在 React 中从查看模拟时钟更改为数字时钟
reactjs - 如何将 Firestore 实时更新(onSnapshot)与 redux-observable/rxjs 结合使用?
JavaScript 正则表达式 : Can I get the last matched index or search backwards/RightToLeft?