Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.67/5 (3 votes)
how CSS commands interact with style properties of tags?
Posted
Comments
Sergey Alexandrovich Kryukov 10-Dec-14 15:22pm    
This is such a simple and basic aspect of the operation that it's hard to understand what is unclear. First of all, there are no "CSS commands". And there is nothing to "interact" with.
—SA

When you need info on a basic concept, try google[^] first. There are a lot of different tutorials that can explain it. Good luck!
 
Share this answer
 
Comments
Maciej Los 10-Dec-14 16:17pm    
+5, Google is always good "Knowledge Base" ;)
Please see my comment to the question. It's possible that you don't understand the whole idea of CSS. This is nothing more than the declarative language used to describe styles. You may need to get the idea of declarative languages:
http://en.wikipedia.org/wiki/Declarative_programming[^].

Even though some declarative language may describe something like "commands", nothing like that happens with CSS. When the browser loads some HTML file, it loads all the CSS code, no matter if it is all embedded in that HTML or separate files (resources) are referenced. It's important to understand that it happens only once. The style properties read from CSS are put in HTML DOM which ultimately defines the rendering of HTML. One can access DOM via Javascript and modify it. There is nothing dynamic in the CSS code written in HTML or CSS files; it remains fixed. When you dynamically modify, add, remove or replace styles of an HTML element, you do it to DOM; and all those changes immediately change the rendering of the page.

Please see: http://en.wikipedia.org/wiki/Document_Object_Model[^],
http://www.w3schools.com/js/js_htmldom_css.asp[^] (you can find very basic explanation of changing styles here).

—SA
 
Share this answer
 
Comments
Maciej Los 10-Dec-14 16:16pm    
+5!
Sergey Alexandrovich Kryukov 10-Dec-14 16:30pm    
Thank you, Maciej.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900