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 7604347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:53:14+00:00 2026-05-30T23:53:14+00:00

I have a bunch of elements that look like.. <div id=hi> <div class=head> </div>

  • 0

I have a bunch of elements that look like..

<div id="hi">
    <div class="head">
    </div>
    <div class="footer">
    </div>
</div>

..except some of them don’t have the footer element, only a head. I want to give elements without a footer a bottom border. I’m hoping for something like..

#hi:hasno(.footer) {
    border-bottom: 1px black dotted;
}

Is there a CSS selector I could use for this, or should I just use a JavaScript equivalent?

  • 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-30T23:53:15+00:00Added an answer on May 30, 2026 at 11:53 pm

    You can select elements that contain no other elements using the :empty selector, but what you need won’t be available until CSS Selectors Level 4’s :has and :not(selector list) are both implemented in browsers. So no, it can’t be done in pure CSS. Now whether or not you should use a JavaScript equivalent depends on what you really want to achieve here. If it’s a minor detail, feel free to add it with JavaScript if it’s not too much of a problem. If it’s a huge, essential feature, consider restructuring so you don’t need this kind of selector.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of elements that look like this: <span class='tags' id='html'>html</span> <span
I have a bunch of elements that look like <div id=username-2343></div> I need to
I have a bunch of divs that are all hidden like this <div class=elements>
I have a bunch of elements like the following: <div class=droppableP id=s-NSW style=width:78px; height:63px;
I have a bunch of elements like this: <div></div> <span></span> <table></table> <div></div> <span></span> <div></div>
I have selected a bunch of li elements that meet a certain criteria like
I have a bunch of input elements that have a particular substring in their
I have code that loads a bunch of images into hidden img elements and
I have a bunch of classes I want to rename. Some of them have
I have an element that needs to behave like UIButton but it has several

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.