Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

Transform แบบ Scale บนแกน X (scaleX) ด้วย CSS3


เมธอด scaleX(x) ใช้สำหรับการ transform แบบ scale บนแกน X

รูปแบบไวยากรณ์ (Syntax):

scaleX(x)

ที่นี่ x เป็นตัวเลขที่แทนตัวคูณการปรับขนาดสำหรับพิกัด x (abscissa) ของแต่ละจุดขององค์ประกอบ

ตัวอย่าง:

div {
  width: 60px;
  height: 60px;
  background-color: yellow;
}
.scaled {
  transform: scaleX(0.5);
  background-color: black;
}