Home > database >  What is the selector class for div inside another div
What is the selector class for div inside another div

Time:06-07

I'm trying to apply styles for Menu class. However, when I'm writing some CSS properties to the menu the styles are not applying. How to select the exact CSS class div inside another div that to div inside header like this code below

<section >
        <header>
            <img src="assets/images/logov2.png" alt="company-Logo" style="width:160px;height:20px;">
            <div >
                <ul>
                    <li><a href="#">How it works</a></li>
                    <li><a href="#">About</a></li>
                    <li><a href="#">Team</a></li>
                    <li><a href="#">Contact</a></li>
                </ul>
            </div>
            <div >
                Get Early Access
            </div>
        </header>
</section>

CodePudding user response:

Just use the tag header as the start point to reach other selectors.

header>img {
  height: 220px;
  width: 300px;
}

header>.menu {
  background-color: red;
}

header>.Access {
  padding: 10px;
  background-color: yellow;
}
<section >
  <header>
    <img src="https://images.unsplash.com/photo-1554232456-8727aae0cfa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=735&q=80" alt="company-Logo">
    <div >
      <ul>
        <li><a href="#">How it works</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Team</a></li>
        <li><a href="#">Contact</a></li>
      </ul>
    </div>
    <div >
      Get Early Access
    </div>
  </header>
</section>

  • Related