Skip to content

Commit dd50806

Browse files
committed
Transform, Transition and Animation - transform:scale()
1 parent cc6509d commit dd50806

File tree

2 files changed

+21
-25
lines changed

2 files changed

+21
-25
lines changed

index.html

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,8 @@
1111
</head>
1212

1313
<body>
14-
<div class="hero">
15-
<div class="hero-center">
16-
<h1>hello world</h1>
17-
<p>
18-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Aut quos quia
19-
asperiores incidunt accusantium tenetur saepe, eaque sequi? Ipsum
20-
dicta illo corrupti voluptatibus minus explicabo quae officia odit
21-
consequuntur distinctio!
22-
</p>
23-
</div>
24-
</div>
14+
<div class="one"></div>
15+
<div class="two"></div>
16+
<div class="three"></div>
2517
</body>
2618
</html>

styles.css

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
/*
2-
transform:translate() - Hero Example
2+
transform:scale() - 1 is current size
33
*/
44

5-
* {
6-
margin: 0;
5+
div {
6+
width: 150px;
7+
height: 150px;
8+
display: inline-block;
79
}
810

9-
.hero {
10-
min-height: 100vh;
11-
position: relative;
11+
.one {
12+
background: red;
13+
transform: scaleX(0.5);
1214
}
1315

14-
.hero-center {
15-
border: 2px solid red;
16-
position: absolute;
17-
top: 50%;
18-
left: 50%;
19-
transform: translate(-50%, -50%);
20-
min-width: 300px;
21-
text-align: center;
16+
.two {
17+
background: blue;
18+
transform: scaleY(2);
19+
}
20+
21+
.three {
22+
background: green;
23+
/* transform: translateX(50%); */
24+
/* transform: scale(1.5, 1.5); */
25+
transform: scale(2);
2226
}

0 commit comments

Comments
 (0)