1

Styling in React.js

 2 years ago
source link: https://dev.to/gargkunal/styling-in-reactjs-364a
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Styling in React.js

Today we are going to learn styling in css and how to declare variables and all.

For styling we can use inline and external file css which can be component based or page based. So we are going to use className for naming the component.

Also we can use variable for reuse value through the component.

Given below the example

 <div className="nav-wrapper">
      <nav className='nav-heading'>{c}</nav>
      <ul className='nav-items'>
        <li>Home</li>
        <li>Contact</li>
        <li>About</li>
      </ul>
    </div>

Enter fullscreen mode

Exit fullscreen mode

Css Code

.nav-wrapper{
    display: flex;
    height: 80px;
    background-color: aliceblue;
    width: 100vw;
    padding: 0 !important;
}

Enter fullscreen mode

Exit fullscreen mode


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK