React : CSS class name import not working

后端 未结 15 1622
轻奢々
轻奢々 2020-12-31 20:16

i have a

div in my react component and im importing some class name from a class css file, but the class name is not getting integrated to the main
15条回答
  •  不知归路
    2020-12-31 20:49

    import './Layout.css';

    Then use it like a normal CSS

    You can also use your classes as objects with this format:

    In your CSS file:
    Wrap your classes and id's with :local(.className)

    Example
    :local(.Content) { width: 100px; }

    In your React Component:
    import classes from './stylesheet.css'

提交回复
热议问题