Home >Web Front-end >Front-end Q&A >What do js and css refer to in web page code?
JS in web page code refers to javascript, which is a lightweight, interpreted or just-in-time compiled high-level programming language with function priority. It is often used to add various dynamic functions to web pages; CSS refers to cascading style sheets, which is a computer language used to express file styles such as HTML or XML.
The operating environment of this article: windows7 system, ECMAScript 2018&&css3 version, Dell G3 computer.
Recommended: javascript video tutorial, css video tutorial
In the web page code, js refers to javascript, and css refers to cascading style sheets ( Cascading Style Sheets).
javascript
JavaScript ("JS" for short) is a lightweight, interpreted or just-in-time compiled high-level programming language with function priority. Although it is famous as a scripting language for developing Web pages, it is also used in many non-browser environments. JavaScript is based on prototype programming, a multi-paradigm dynamic scripting language, and supports object-oriented, imperative and declarative ( such as functional programming) style.
JavaScript is a high-level scripting language that belongs to the Internet. It has been widely used in Web application development. It is often used to add various dynamic functions to web pages and provide users with smoother and more beautiful browsing effects. Usually JavaScript scripts realize their functions by embedding them in HTML.
Daily use:
Embed dynamic text in HTML pages.
Respond to browser events.
Read and write HTML elements.
Validate data before it is submitted to the server.
Detect the visitor’s browser information.
Control cookies, including creation and modification.
Server-side programming based on Node.js technology.
css (Cascading Style Sheets)
Cascading Style Sheets (full English name: Cascading Style Sheets) is a type of HTML (standard A document-style computer language such as XML (an application of Universal Markup Language) or XML (a subset of Standard Universal Markup Language). CSS can not only statically modify web pages, but can also cooperate with various scripting languages to dynamically format various elements of web pages.
CSS can perform pixel-level precise control over the layout of element positions in web pages, supports almost all font size styles, and has the ability to edit web page objects and model styles.
Features:
Rich style definition
CSS provides rich document style appearance, as well as setting text and background The ability of attributes; allows you to create a border for any element, as well as the distance between the element border and other elements, as well as the distance between the element border and the element content; allows you to freely change the capitalization, decoration, and other page effects of text.
Easy to use and modify
CSS can define the style in the style attribute of the HTML element, or in the header part of the HTML document, or in the Styles are declared in a special CSS file for reference in HTML pages. In short, CSS style sheets can store and manage all style declarations in a unified manner.
In addition, elements of the same style can be classified and defined using the same style, you can also apply a certain style to all HTML tags with the same name, or you can assign a CSS style to a certain in page elements. If we want to modify the style, we only need to find the corresponding style statement in the style list and modify it.
Multi-page application
CSS style sheet can be stored in a separate CSS file, so that we can use the same CSS style sheet in multiple pages. Theoretically, CSS style sheets do not belong to any page file and can be referenced in any page file. In this way, the styles of multiple pages can be unified.
Cascading
Simply put, cascading is to set the same style multiple times on an element, which will use the last attribute value set. For example, if you use the same set of CSS style sheets for multiple pages in a site, and if you want to use other styles for some elements in some pages, you can define a separate style sheet for these styles and apply them to the page. These styles defined later will override the previous style settings, and what you see in the browser will be the style effect set last.
Page compression
In websites that use HTML to define page effects, a large number or repeated tables and font elements are often required to form text styles of various specifications. The consequence is that a large number of HTML tags will be generated, thereby increasing the size of the page file. Putting the style declaration separately in the CSS style sheet can greatly reduce the size of the page, so the time spent loading the page will also be greatly reduced. In addition, the reuse of CSS style sheets reduces the size of the page to a greater extent and reduces the download time.
For more programming-related knowledge, please visit: Programming Teaching! !
The above is the detailed content of What do js and css refer to in web page code?. For more information, please follow other related articles on the PHP Chinese website!