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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:45:35+00:00 2026-05-15T16:45:35+00:00

Is there any way only using CSS (no script) to check if an element

  • 0

Is there any way only using CSS (no script) to check if an element such as a table contains another element such as with the target? I know that you can use the :target pseudo class for elements with the target, but I need the ability to select an element which contains the element with the target. If there’s any way to using the :contains pseudo class to check if an element contains the target that’d be useful, however I’ve tried it a few different ways with no success. I know there isn’t a parent selector which rules out looking for the parent of the element with the target URI. The only possible ways I can think of are using :contains and I don’t think that’ll even work with anything but text. If anyone knows some sort of trick or other selector that’d solve this issue, help would be appreciated.

  • 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-15T16:45:36+00:00Added an answer on May 15, 2026 at 4:45 pm

    First guess:

    I’m having a hard time understanding your question, so my answer is offered on the assumption that your question is something like this:

    Is there any way to style the parent of a targeted element?

    And the answer is no, css works by cascading down the hierarchy, it can’t cascade up; have a read of the following questions/answers for further details:

    • CSS Parent/Ancestor Selector
    • Is there a CSS parent selector?
    • Complex CSS selector for parent of active child

    (There are others, if you search for ‘css parent selectors‘)


    Second guess:

    If your question is:

    can I find links that target other sections of the same page?

    Then yes, you can (with css3 and/or using jQuery):

    a[href*='#'] { /* css */ }
    $("a[href*='#']") // jQuery selector
    

    The href*='#' part is an attribute-selector, that searches the ‘href’ attribute for any occurrence1 of the quoted string ‘#’ (the # being used to target same-page links).

    If you’re able to revise your question to make it more clear what you’d like us to help you with, then I’ll be more than happy to try and be more use to you, but as it is I can only guess. Which is pretty much useless. =(


    Footnotes:

    1. Other options are:
      • starts with, eg: a[href^='http://'] which selects all links whose href begin with ‘http://’, and
      • ends with, eg: a[href$='.pdf'], which selects all links that end with the filetype .pdf.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering if there was any way using only CSS, (and this CAN
Is there any way to do the opposite of :hover using only CSS? As
Is there any way to completely process a form using only javascript & html
Is there any way in MySQL to only log deletes? I tried using the
Is there any way to find out diagonals of quadrilateral if I only know
Is there any way to show only week day with Date as: MON 03-JUL
Is there any way to select only innermost tables? That is ones that do
Is there any way to make only a non-transparent portion of an image to
Is there any way to freeze the screen and show only one form active
Is there any way to do something conditionally in jquery only if IE6 is

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.