Меню
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON PHP КАК СДЕЛАТЬ
     ❯   

CSS Справочники


CSS Свойства





scale



Example

Change size of an element:

div {
  scale: 2;
}
Try it Yourself »

Definition scale

Подработка: Перевод страницы

The scale property allows you to change the size of elements.

The scale property defines values for how much an element is scaled in x- and y-directions. You can also define how much an element is scaled in z-direction.

Scale values can be given as one value, two values, or three values.

  • If one value is given, the element is scaled the same amount in both x- and y-direction.
  • If two values are given, the element is scaled in x- and y-direction individually.
  • If three values are given, the element is scaled in x-, y- and z-direction individually.

To better understand the scale property, view a demo.

Note: An alternative technique to scale an element is to use CSS transform property with CSS scale() function. The CSS scale property, as explained on this webpage, is arguably a simpler and more direct way to scale an element.

Show demo ❯

Default value: none
Inherited: no
Animatable: yes. Read about animatable Try it
Version: CSS3
JavaScript syntax: object.style.scale="2 0.7" Try it

Browser Support scale

The numbers in the table specify the first browser version that fully supports the property.

Property
scale 104 104 72 14.1 90


CSS Syntax scale

scale: x-axis y-axis z-axis|initial|inherit;

Property Values scale

Property Value Description Demo
x-axis Defines scale factor at the x-axis. Possible values:
  • number
  • %
Demo ❯
y-axis Defines scale factor at the y-axis. Possible values:
  • number
  • %
Demo ❯
z-axis Defines scale factor at the z-axis. Possible values:
  • number
  • %
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

More Examples scale

Example

When scale property is set with two values, the size is set on x-axis and y-axis individually. Here, the element becomes double in size on x-axis and half the size on y-axis:

div {
  scale: 2 50%;
}
Try it Yourself »

Related Pages scale

CSS tutorial: CSS 2D Transforms

CSS tutorial: CSS 3D Transforms

CSS rotate property: CSS Rotate property

CSS translate property: CSS Translate property



×

Связаться с отделом продаж

Если вы хотите использовать услуги schoolsw3 как образовательное учреждение, команда или предприятие, отправьте нам электронное письмо:
sales@schoolsw3.com

Сообщить об ошибке

Если вы хотите сообщить об ошибке или внести предложение, отправьте нам электронное письмо:
help@schoolsw3.com

Schoolsw3 оптимизирован для обучения и подготовки. Примеры могут быть упрощены для улучшения чтения и обучения. Учебники, ссылки и примеры постоянно проверяются, чтобы избежать ошибок, но мы не можем гарантировать полную правильность всего контента.
При использовании Schoolsw3 вы соглашаетесь прочитать и принять наши условия использования,
политику использования файлов cookie и конфиденциальности.

Авторское право 1999- © Copyright. Все права защищены. Schoolsw3 работает на SW3.CSS.