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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:16:00+00:00 2026-05-27T15:16:00+00:00

I have this in my HTML file: <td> <div class=something>someText</div> <div class=something>otherText</div> </td> Is

  • 0

I have this in my HTML file:

<td>
    <div class="something">someText</div>
    <div class="something">otherText</div>
</td>

Is there a way in CSS I can set the background of the PARENT of the class named something? In this case, the tag?

Here is my code:

    <script type="text/javascript">
       function MyMethod(sender, eventArgs) {
           if (condition) {
               app.set_cssClass("MyClass");
           }
           $('.MyClass').parent().css('background', 'url(Images/star.png) no-repeat')
        }
    </script>
  • 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-27T15:16:01+00:00Added an answer on May 27, 2026 at 3:16 pm

    At this point, no.

    However, jQuery can do this quite easily.

    $('.something').parent().css('//WHATEVER')

    In the future, CSS4 will be adopting a subject selector, which would do what you need

    $OL > LI:only-child

    The $ would be used to select the parent or subject of a specific element.

    http://www.w3.org/TR/selectors4/#subject

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

Sidebar

Related Questions

Hi I have a html called 1.html file like this <div class=t_l></div> <some> lines
I have an html form that looks something like this: <div class=field> <input id=product_name
I have nav code like this in my HTML file: <div id="center_links"> <ul> <li><a
I have this simple piece of HTML code: <div> <input type=file name=english-file /> </div>
So I have this file: <h1>Calendar view</h1> <div class=events> <% @events.each do |e| %>
I have this code: reg = re.search('<div class=col result_name>(.*)</div>', html) print 'Value is', reg.group()
I have this html: <div class=speaker-list> <div class=view-content> <div class=views-row views-row-1 views-row-odd views-row-first> <div
I have a page that looks something like this: ... <div class=container> <div class=info>
I have this html file where I want to overlay some text over another.
I have this tag into my html file: {{block:my_test_block}} {{news:my_test_block2}} I need to parse

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.