Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6836247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:20:00+00:00 2026-05-26T23:20:00+00:00

I have this code on a login page: <div id=header> <div id=homeBanner> … </div>

  • 0

I have this code on a login page:

<div id="header">
    <div id="homeBanner">
        ...
    </div>
</div>
<div id="navigation">
    ...
</div>

I’d like to select div#navigation but only when it follows div#header that contains div#homeBanner. The reason is I have similar code on a different page:

<div id="header">
    <div id="siteBanner">
        ...
    </div>
</div>
<div id="navigation">
    ...
</div>

I don’t want to affect the style of div#navigation when it follows div#header that contains div#siteBanner. Does this make sense?

How do I select div#navigation only when it follows div#header that contains div#homeBanner? I thought it was:

div#header div#homeBanner > div#navigation

… but that doesn’t seem to work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:20:01+00:00Added an answer on May 26, 2026 at 11:20 pm

    Problem here is that you’re trying to select the sibling of a parent element based on the parent’s child, which isn’t possible in CSS.

    Your best bet is to add a class to #header (or even body) based on that information then make use of that class.

    For example:

    <div id="header" class="home">
        <div id="homeBanner">
            ...
        </div>
    </div>
    <div id="navigation">
        ...
    </div>
    

    With this selector (as mentioned by others, use + for siblings, not > for children):

    #header.home + #navigation
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code, which works fine, but I would like to be able
Please help. I have page login/auth.gsp with the following code inside the body <div
I'd like to have the white background cover content of the page but for
I have this html: <div id=signbtn> <a id=login-link class=btnsignin title=Login>Sign in</a> </div> Upon successful
I have this code to log people in with Facebook: <div id=fb-root></div><script src=http://connect.facebook.net/en_US/all.js#appId=my_app_id&amp;xfbml=1> </script><fb:login-button
I have in the fact copied the code of Login page in the ASP.NET
I have page main.html in it i have this code in the body tag:
On my index page I have a link to my login.php page with this
I have this in my PHP code, and it currently does the login request
I have this code: using DC = MV6DataContext; using MV6; // Business Logic Layer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.