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

  • Home
  • SEARCH
  • 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 8406697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:10:53+00:00 2026-06-09T23:10:53+00:00

I want to load the css properties in javascript. I have two canvases and

  • 0

I want to load the css properties in javascript.

I have two canvases and i have loaded a css file in the head tag.

I want to do that when a certain option is selected, the css of the canvases change. If it would be simple css it could be done by ‘canvas.style.csstext’ but i’m applying transform for tilting the element so it doesn’t work in ‘canvas.style.csstext’.

So how can i do that!

  • 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-09T23:10:55+00:00Added an answer on June 9, 2026 at 11:10 pm

    OK, I’ll post as an answer here so others can see.

    There’re various methods, like injecting a link element, or use document.styleSheets[0].insertRule, but in your case, a better solution would be to include both CSS files in header, with different selectors, and modify the canvas.className when needed.

    Illustration:

    <link href="main.css" /> <!--canvas{border:...}-->
    <link href="alternate.css" /> <!--canvas.alter{border:...}-->
    <!--...-->
    <canvas id="needToAlter"></canvas>
    <button onclick="document.getElementById('needToAlter').className+=' alter';">Alter</button>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code that will load css/js/jst (javascript templates) using $.ajax and I'd
I want to load an image via css that stretches to the entire screen.
i have a website that uses screen.css as main CSS file. I added this
I have page for which I want to load different template file for different
What is the syntax if I want to load a css file in my
In Flex 4 i want to load css file from remote server at runtime
I want load a css or scss file of my rails 3.1 project with
i'm having problem when i want to load css file with document.write() when i
I want to load some .css files to my Django project but I don't
I am using CakePHP 2.0 and I want to load a concrete CSS style

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.