📜  CSS 和 CSS3 的区别

📅  最后修改于: 2021-09-13 02:08:13             🧑  作者: Mango

CSS: CSS 代表级联样式表。它的主要目标是为网页提供样式和时尚。 CSS 提供颜色、布局、背景、字体和边框属性。 CSS 特性允许更好的内容可访问性、增强的灵活性和控制,以及表现特性的规范。

CSS3: CSS3 代表 Cascading Style Sheet level 3,它是 CSS 的高级版本。它用于结构化、样式化和格式化网页。 CSS3 中添加了一些新功能,所有现代 Web 浏览器都支持它。 CSS3 最重要的特性是将 CSS 标准拆分为更易于学习和使用的单独模块。

CSS 和 CSS3 的区别:

S.No. CSS CSS3
1 CSS is capable of positioning texts and objects. CSS is somehow backward compatible with CSS3. On the other hand, CSS3 is capable of making the web page more attractive and take less time to create it. If you write CSS3 code in CSS, it will be invalid.
2 Responsive designing is not supported in CSS CSS3 is the latest version, hence it supports responsive design.
3 CSS cannot be split into modules. Whereas, CSS3 can be breakdown into modules.
4 Using CSS, we cannot build 3D animation and transformation. But in CSS3 we can perform all kinds of animation and transformations as it supports animation and 3D transformations.
5 CSS is very slow as compared to CSS3 Whereas, CSS3 is faster than CSS.
6 In CSS we have a good collection of unique color schemas and standard color. Whereas, CSS3 has a good collection of HSL RGBA, HSLA, and gradient colors.
7 In CSS we can only use single text blocks. But in CSS3 we can use multi-column text blocks
8 CSS does not support media queries. But CSS3 supports media queries
9 CSS codes are not supported by all types of modern browsers. Being the latest version, CSS3 codes are supported by all modern browsers.
10 In CSS, designers have to manually develop rounded gradients and corners. But CSS3 provide codes for setting rounded gradients and corners
11 There is no special effect like shadowing text, text animation, etc. in CSS. The animation was coded in jQuery and JavaScript. CSS3 has many advance features like text shadows, visual effects, and a wide range of font style and color.
12 In CSS, the user can add background colors to list items and lists, set images for the list items, etc. Whereas, CSS3 list has a special display property defined in it. Even list items also have counter reset properties.

CSS3的新特性:

  1. 组合器: CSS3 有一个新的通用同级组合器,它通过波浪号 (~) 组合器与同级元素匹配。

  2. CSS 选择器:与 CSS 提供的简单选择器相比,CSS3 选择器要先进得多,被称为一系列易于使用和简单的选择器。

  3. 伪元素: CSS3 中添加了大量新的伪元素,以提供简单的深度样式。甚至还添加了双冒号 :: 的新约定。

  4. 边框样式:最新的 CSS3 还具有新的边框样式功能,例如边框半径、图像切片、图像源和“宽度拉伸”值等。

  5. 背景样式属性: CSS3 中添加了背景剪辑、大小、样式原点属性等新功能。