NoobyAFK
NoobyAFK

Reputation: 307

How to select with css specific id only if have specific class on same div?

So this is situation, fist code show class when nav is on bottom...

<div id="navigation" class="attached-to-bottom">
 <ul>
  <li></li>
  <li></li>
  <li></li>
 </ul>
</div>

this show when my navigation stay sticket to top after i scroll down (with jquery etc etc), but i need change navigation id height to be different when i triger class "attached-to-top") Can i do that with CSS only or?

 <div id="navigation" class="attached-to-top">
     <ul>
      <li></li>
      <li></li>
      <li></li>
     </ul>
    </div>

Upvotes: 0

Views: 3655

Answers (1)

Michael
Michael

Reputation: 7092

Simply don't use a space between them.

#navigation.attached-to-top { height: 100px; }

More information on CSS Selectors

Upvotes: 5

Related Questions