[Webinar] Streamline your web hosting managementRegister Today


Programmatically change CSS Style Attributes

Posted on 2006-04-27
Medium Priority
Last Modified: 2013-11-19
Is it possible to programmatically change CSS style attributes?  That is, to change the attribute within a named style, not to change the name of a class assigned to an element.   If so, what's the general approach?

Question by:codequest
LVL 14

Accepted Solution

nltech earned 1000 total points
ID: 16558733

has several examples, using javascript..

look at the first two (pages 2 & 3), changing styles of id's and page elements (doesn't involve swapping classes).

the last ones (pages 4 & 5) deal with swapping one class for another (which you say you don't want).

Author Comment

ID: 16558759
Thanks for the input.  That's a great article, and it does answer the question.  However, I think I asked the wrong question.   So I'm going to award the points and re-ask, once I figure out what the right question is.


Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question