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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:01:44+00:00 2026-06-05T22:01:44+00:00

I’ve just noticed that Webkit now has some support regarding the CSS Values and

  • 0

I’ve just noticed that Webkit now has some support regarding the CSS Values and Units Module Level spec. And I was wondering if anyone knows if there is a way to reference another CSS selectors (or DOM style) property from a CSS selector?

I’m expecting something like this to be the answer here. Which I know is most likely the case for current browser implementations; but please keep reading…

For instance, in the case where an animation might resize an element (NOTE the ${.element2.width} is fictitious syntax):

<style type="text/css">
.element1 {
  .width: /*-webkit-,-o-,-moz-*/calc(80% - ${.element2.width});
}
.element2 {
  .width: 100px;
}
.element2:hover {
  width: 200px;
  transition: all 0.4s ease-in-out;
}
</style>

In this case I would expect the .element1’s width to be re-evaluated based off the transition triggered from the hover events on .element2.

I realize that the aforementioned spec. is only a working draft but perhaps the syntax for referring to such a ‘referential selector property’ is defined within another spec. which I’m yet to discover? Or simply just not a case for concern (thanks to an overlooked work around)?

  • 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-06-05T22:01:47+00:00Added an answer on June 5, 2026 at 10:01 pm

    I added an answer to the question you linked: https://stackoverflow.com/a/11071806/137626

    • You can use the same declaration block with as many selectors as you want by grouping them (selectors are separated by commas)
    • You can’t reuse the same declaration block later with a different CSS selector without rewriting the whole declaration block preceded by this selector or using a preprocessor/macro that’ll do that for you. Or add it to the existing declaration block as above

    Now with your example of an element resized by CSS itself: you could use CSS3 Media Queries and its @media rules containing as many declaration blocks as you want. These media queries would adapt to the width of viewport here.
    Mixing expanding elements via animation and media queries that would’ve the reverse effect will be very soon very complicated (and I’ll wonder what content you’re playing with); if you want to Keep It Simple, then JS is the way to go. There are variables, loops, events 😉 and you can start a CSS3 animation by adding or removing a single class from an element (or whatever CSS selector).
    CSS3 won’t replace JS (and you shouldn’t use JS to style HTML as JS isn’t activated or existing everywhere and there’s already a nice fallback named CSS).

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have just tried to save a simple *.rtf file with some websites and
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.