2

I am new to materialize css. I have made a navbar which has 4 li tags and one of it contains button. Now I want to change navbar background color and button size should be resized. How can I change the default color(red) of navbar and default color of button also I want to resize the button.How can it be done ?

header.js:

import React, { Component } from 'react';

class Header extends Component {

  render() {
    return (
      <div>   
          <nav>
            <div class="nav-wrapper">
              <a href="#" class="brand-logo">Udacity Logo</a>
              <ul id="nav-mobile" class="right hide-on-med-and-down">
                <li><a href="#">Nanodegree</a></li>
                <li><a href="#">Hire Talent</a></li>
                <li><a href="#">For Business</a></li>
                <li><a class="waves-effect waves-light btn">Course Finder</a></li>
              </ul>
            </div>
          </nav>
      </div>
    );
  }
}

export default Header;

What should I add in header.css ?

Screenshot:

enter image description here

1 Answer 1

3

Try by adding a class to nav like <nav class="yourClassName"> and set color in this css class

.yourClassName{
   background:colorName
}

Simillary add another class here

<li><a class="waves-effect waves-light btn customClass">Course Finder</a></li>

.customClass{
   width:xxpx
}

If default property does not get overwritten use !important

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks but how can I resize the button in 4th li tag
@stonerock nav li:nth-child(4) {background: red;}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.