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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:26:01+00:00 2026-05-13T12:26:01+00:00

In CSS2 and even in the upcoming CSS3, I can’t find something that would

  • 0

In CSS2 and even in the upcoming CSS3, I can’t find something that would be completely natural and time-saving – applying CSS styles from within other styles, rather than from HTML.

For example:

.awesome-image {
  border: 1px #000 solid;
  margin: 2px;
}

.super-awesome-image {
  .alwesome-image; // or something like that - this is similar to a function call in a functional language
  padding: 2px; 
}

Oftentimes, one doesn’t have access to generated HTML, so modifying CSS is the only choice.

This sort of inheritance support would make life a lot easier because we’d be able to treat CSS rules as “functions” and reuse the code rather than duplicate it.

Or am I missing something and CSS does support this (I’ve never seen it before?) or plans on supporting it? Enlighten me please.

Edit: Consider another example which shows that declaring .awesome-image, .super-awesome-image {common rules} is not elegant:

.border5 {
  border-radius:5px;
  -moz-border-radius:5px;
  -webkit-border-radius:5px
}

I would much rather not pile up every other class that would want to have a border radius in the same definition. Alas, that’s what needs to be done without functional support (I mentioned a lot of times there’s only access to the CSS file and not the HTML itself).

  • 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-13T12:26:01+00:00Added an answer on May 13, 2026 at 12:26 pm
    • It would make recursion possible (which would mean parsers would need to be able to recover from it)
    • Multiple rule-sets can use the same selector, so which one would apply? Or would all of them?

    You can achieve what you want with:

    <img … class="awesome-image super-awesome-image">
    

    or

    .awesome-image,
    .super-awesome-image {
      border: 1px #000 solid;
      margin: 2px;
    }
    
    .super-awesome-image {
      padding: 2px; 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I convert a CSS3 or CSS2-based HTML page into a JPEG or
The CSS2 box model tells us that adjoining vertical margins collapse . I find
Is what I state in the table possible with css3? In css2 you can't
how text overflow end with the dots in css2? Design that i done is
In the CSS2.1 standard, I see that font-weight exists: http://www.w3.org/TR/CSS21/fonts.html#font-boldness But I get the
I'm working on an experiment & I found out that the outline CSS2 property
How does the CSS Block Formatting Context work? CSS2.1 specifications says that in a
Why visual Studio is not show css3.0 it always shows css2.1. i have searched
The CSS2.1 spec mandates that overflow other than visible establish a new block formatting
After re-reading the CSS2.1 and CSS3 selector specs I suspect this is impossible, but

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.