"CSS Online Manual" is the official CSS online reference manual. This CSS online development manual contains various CSS properties, definitions, usage methods, example operations, etc. It is an indispensable online query manual for WEB programming learners and developers! CSS: Cascading Style Sheets (English full name: Cascading Style Sheets) is an application used to express HTML (Standard Universal Markup Language).
CSS (full English name: Cascading Style Sheets) is a computer language used to express file styles such as HTML (an application of Standard Generalized Markup Language) or XML (a subset of Standard Generalized Markup Language). .
CSS can not only statically modify web pages, but can also work 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.
Tip: Before continuing to learn CSS, you need to have a basic understanding of HTML and XHTML knowledge.
CSS Language Basics
Attributes
The name of the attribute is a legal identifier, they are CSS Keywords in grammar. An attribute specifies an aspect of formatting.
For example: color is the color attribute of the text, and text-indent specifies the indentation of the paragraph.
Attribute value
Integers and real numbers
Length
-
Percent quantity
Selector
CSS selector is used to select the style of the element you want. model. Elements in HTML pages are controlled through CSS selectors.
Each css style definition consists of two parts, with the following form:
[code] Selector {style} [/code] The part before {} is the "selector". The "selector" specifies the object of the "style" in {}, that is, which elements in the web page the "style" acts on.
The following will introduce to you how the style sheet definition displays HTML elements.
Create and run your first CSS instance!
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文网(php.cn)</title> <style> body { background-color:#d0e4fe; } h1 { color:orange; text-align:center; } p { font-family:"Times New Roman"; font-size:20px; } </style> </head> <body> <h1>CSS 实例!</h1> <p>这是一个段落。</p> </body> </html>
Isn’t it very simple! CSS provides a style description for the HTML markup language that defines how elements in it are displayed. CSS is a breakthrough in the field of web design. It can be used to modify a small style to update all page elements related to it.
Tip: Our CSS tutorial will help you step by step how to use CSS to control the style and layout of multiple web pages at the same time. If you have any questions, please go to the PHP Chinese website CSS Community to ask your questions, and enthusiastic netizens will answer them for you.
Features of CSS language
Rich style definitions: CSS provides rich document style appearance, as well as the ability to set text and background attributes; allows for 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; allowing you to change the capitalization, decoration, and other page effects of text at will.
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 the style can be 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, or a certain style can be applied to all HTML tags with the same name , you can also assign a CSS style to a page element. 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 of this is that A large number of HTML tags, thus increasing the page file size. 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.
What this CSS tutorial manual covers
This CSS tutorial manual covers all basic CSS knowledge, including CSS definition, CSS syntax, CSS properties, CSS usage, An introduction to CSS responsiveness, as well as many online examples and a complete CSS property reference manual, etc.
Tips: Each chapter of this tutorial contains many CSS examples. You can directly click the "Run Example" button to view the running results online. These examples will help you better understand and use the CSS language.
Other CSS-related learning reference resources
In addition to the knowledge expansion on the right side of this page, the following resources are also selected for everyone
Latest chapter
Related courses
- Quick introduction to web front-end development 2021-12-10
- The front-end course that understands you best: HTML5/CSS3/ES6/NPM/Vue/...[Original] 2022-09-30
- Gulp Getting Started Video Tutorial 2022-04-18
- Brothers in Arms Gao Luofeng CSS3 video tutorial 2022-04-20
- AngularJS development web application basic example video tutorial 2022-04-18
- Ajax full contact 2022-04-13
- MUI framework basic video tutorial 2022-04-13
- Online training class trial class 2019-01-10