简体   繁体   English

谁能告诉我为什么在不处理样式组件之前?

[英]Can anyone tell me why before not working on styled components?

I'm try to use before on style components on React but it's not working.before尝试在 React 上的样式组件上使用,但它不起作用。 Without before background image shown but after adding this before background image not showing;没有显示before的背景图像,但在没有显示背景图像before添加了这个;

import styled from  'styled-components'
export const Container=styled.div `
&:before {
content:'';
top:0px;
left:0px;
right:0px;
position:absolute;
background-image:url(${({bg})=>bg});
background-size:cover;
}
`;

try::before with double ":" Also give some height/width try::before with double ":" 也给出一些高度/宽度

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我在使用样式化组件加载 .svg 图像时遇到问题。 谁能告诉我为什么它不加载? - I'm having trouble loading an .svg image in react using styled components. Can anyone tell me why its not loading? 谁能告诉我为什么这一次有效? - Can anyone tell me why this is working once? 谁能告诉我为什么我的Scrollspy无法正常工作? - Can anyone tell me why my Scrollspy is not working? 谁能告诉我为什么这个循环无法正常工作? - Can anyone tell me why this loop isn't working as it should? 谁能告诉我为什么我的JavaScript点击无法正常工作? - can anyone tell me why my javascript clicks isnt working? 谁能告诉我为什么不返回值? - Can anyone tell me why the value is not returned? 谁能告诉我为什么这个javascript函数调用不起作用? - Can anyone tell me why this javascript function call isn't working? 尝试使用JQuery突出显示表行但不起作用,有人可以告诉我为什么以及如何解决它吗? - Trying to highlight table row using JQuery but not working, can anyone tell me why and how to fix it? 谁能告诉我为什么这个 script.js 不起作用? - Can anyone tell me why this script.js isn't working? 谁能告诉我为什么我的最后2个如果其他语句不起作用? 全新的JavaScript在这里 - Can anyone tell me why my last 2 if else statements are not working? Brand new to JavaScript here
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM