It’s a common practice to write a CSS file for our HTML. Those are called static CSS. When we want to create our Cascading Style Sheet rule at runtime, we need jQuery. The jQuery enables us to apply styles to our HTML dynamically.
The CSS rules once written can be stored in a variable and used multiple times wherever needed.
We use jQuery’s css(“arrtibute1”, “value1”).
Below example illustrates the approach:
- How to override the CSS properties of a class using another CSS class ?
- CSS | column-rule-width Property
- CSS | column-rule Property
- CSS | column-rule-style Property
- CSS | column-rule-color Property
- CSS | @charset Rule
- CSS | @media Rule
- CSS | @keyframes Rule
- What does the CSS rule “clear: both” do?
- How to create responsive image gallery using HTML, CSS, jQuery and Bootstrap?
- How to create followspot effect using HTML CSS and jQuery ?
- CompileTime Vs RunTime Resolution of Strings
- How to set href attribute at runtime?
- How to fire event if CSS class is changed using jQuery ?
- How to find the parent class name with known class in jQuery ?
- Strict Aliasing Rule in C with Examples
- How to create slide left and right toggle effect using jQuery?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.