Home >Web Front-end >Front-end Q&A >What is the difference between js and css
The difference is: 1. CSS is for web page performance, and JS is for web page behavior; 2. CSS statically modifies the web page, which can make the page display in a certain layout, while js has various dynamic effects on the page. Processing can be used to implement functions such as web page and human interaction.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
CSS is web page presentation and JS is web page behavior.
css statically modifies the web page so that the page can be displayed in a certain layout.
CSS is a markup language that separates style information from web page content. We use css to define styles for each element; it is mainly used to beautify HTML pages.
JS handles various dynamic effects on the page and can be used to realize the functions of interaction between web pages and people, such as replacing pictures, scrolling pictures, displaying and hiding layers, processing shortcut keys, etc. .
CSS (Cascading Style Sheet) Cascading Style Sheet
Presentation - Design the presentation style of the web page, that is, "how to display relevant content"
CSS is a markup language that separates style information from web page content. We use css to define styles for each element; it is mainly used to beautify HTML pages.
The syntax is: selector {property: value} (selector {property: value}).
You can modify the display, position and other styles of each element in the HTML document by setting the corresponding style attributes; such as modifying the color, font, font size, width and height, position, background, etc.
JS (JavaScript) a dynamic scripting language
Behavior (behavior) - controlling the behavior (effect) of the web page, that is, "how the content should react to events"
Use JavaScript code can make the front desk interactive (click events), and is often used to add a variety of dynamic functions to web pages to provide users with a smoother and more beautiful browsing effect. Usually JavaScript scripts realize their functions by embedding them in HTML.
Recommended learning: css video tutorial
The above is the detailed content of What is the difference between js and css. For more information, please follow other related articles on the PHP Chinese website!