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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:03:20+00:00 2026-05-18T08:03:20+00:00

In some browsers (namely, Firefox) the getComputedStyle().getPropertyValue() doesn’t report anything for shorthand CSS, like

  • 0

In some browsers (namely, Firefox) the getComputedStyle().getPropertyValue() doesn’t report anything for shorthand CSS, like border. Is there a non-specific-code way of getting these shorthand CSS values? I’ve considered making a whitelist of shorthand CSS and their respective longhand CSS values. But I realize doing that would be both a big pain and a non-forward-compatible design.

  • 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-18T08:03:20+00:00Added an answer on May 18, 2026 at 8:03 am

    I’m wondering, what do you want to do with a string like border: 1px solid #000?

    Say you want to reproduce an elems border in order to copy it copyStyle(el2, el, "border"):

    // Copies a set of styles from one element to another.
    function copyStyle(dest, source, shorthand) {
      var computed = window.getComputedStyle(source, null);
      for (var i = computed.length; i--;) {
        var property = camelize(computed[i]);
        if (property.indexOf(shorthand) > -1) {
          console.log(property)
          dest.style[property] = computed[property];
        }
      }
    }
    
    // prototype.js
    function camelize(text) {
      return text.replace(/-+(.)?/g, function (match, chr) {
        return chr ? chr.toUpperCase() : '';
      });
    }
    

    Comparing if two element’s given set of styles matches can be done in the same manner. Other than that, I really can’t see the use a string, which should be parsed if you want to compute anything with it.

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

Sidebar

Related Questions

Some browsers like Opera have support for IRC so there's no need to have
My CSS has a class circle that contains border-radius: 50% . Unfortunately, some browsers
Modern browsers are supposed to support the CSS page-break properties to some degree. However
I have some login code that works well for Firefox and other browsers, but
There is a common feature of modern browsers where a user can select some
I have seen in some browsers (Firefox for example), the RSS feed icon gets
Some browsers cache js and css files, failing to refresh them unless you force
I have a multiline input on my html form and some browsers (firefox 4
If this can only be done in some browsers, I'd still like to know
I'd like to use autofocus=autofocus in my code, but since some browsers don't support

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.