CSS, the full name of Cascading Style Sheets, is a markup language used to design the layout and appearance of web pages. Its function is to separate the content and style of the web page, so that the web designer can control the appearance of the page more flexibly and precisely.
The earliest version of CSS was released in 1996 and was invented by Hakon Wium Lie and Bert Bos. Its purpose is to separate web page content and style, thereby improving the maintainability, accessibility, and reusability of web pages.
Using CSS, you can specify how HTML elements in a web page should be rendered through style rules in a style sheet. These rules include fonts, colors, backgrounds, borders, sizes, positions, etc., and can modify the appearance of web pages without changing the HTML file.
CSS uses selectors to select elements to apply styles and attributes to specify styles. For example, the following code will set the color of all h1 elements to red:
h1 { color: red; }
CSS styles can be stored in one or more external style sheet files, which can be used jointly by multiple HTML pages, thus improving Code reusability and maintainability. Reference the external style sheet file to the HTML page by using the tag in the HTML file.
At the same time, you can also use the