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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:59:46+00:00 2026-06-09T08:59:46+00:00

The thing is that some css properties have different name is javascript, for example

  • 0

The thing is that some css properties have different name is javascript, for example textOverflow in js is text-overflow in css.

Is there a translation table somewhere in js engine that I can access or I must do myself a translation array or object like:

transObj = { textOverflow : 'text-overflow' };

For example I’m looping through this object and all I get is only js names:

for (var n in csd) {
  if (!csd.hasOwnProperty(n)) continue;
  csd[n].getTrueCSSName() // is there something like this ?
}

Or maybe simple regex replace will be ok, but I don’t know if rule that all big letters in js names tranlsate to -[a-z] in css names ?

  • 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-09T08:59:47+00:00Added an answer on June 9, 2026 at 8:59 am

    All css style which contain a - are replaced by their camelCase representation in ECMAscript, since we can’t use - in all occasions. You can translate the names, by invoking a regular expression like this:

    var name = "font-width";
    
    // convert names like "font-width" into css camelCase form like "fontWidth"
    name = name.replace( /-(\w)/g, function _replace( $1, $2 ) {
        return $2.toUpperCase();
    });
    

    which also works for like -webkit-box-shadow or whatnot.

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

Sidebar

Related Questions

I have this thing that i need to do and some advices will be
I would like to write css or some thing that it will make font-family
With some CSS styling properties, we need all these different kinds of approaches, tricks
I have some JavaScript code that creates some div elements and it sets their
Object slicing is some thing that object looses some of its attributes or functions
I notice a strange thing during doing some stored procedures I can explain that
I have a HAML page that lists some links to delete things that looks
There are some things that I do a lot in a new project, for
I have a legacy web application that was written long before there were even
I'd like to use some CSS that is only supported by Firefox 3.5 at

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.