Skip to content

Commit 29fce3b

Browse files
committed
flex property for responsive page
1 parent 283aa08 commit 29fce3b

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

flex-grow.html

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
<style>
8+
.flex-container
9+
{
10+
display: flex;
11+
font-size: 30px;
12+
}
13+
.flex-grow
14+
{
15+
background-color: blue;
16+
flex-grow: 2;
17+
}
18+
.flex-grow1
19+
{
20+
background-color: red;
21+
flex-grow: 6;
22+
}
23+
.flex-grow2
24+
{
25+
background-color:black;
26+
flex-grow: 10;
27+
color: white;
28+
}
29+
</style>
30+
</head>
31+
<body>
32+
<div class="flex-container">
33+
<div class="flex-grow">Content one with flex-grow=1</div>
34+
<div class="flex-grow1">Content one with flex-grow=2</div>
35+
<div class="flex-grow2">Content one with flex-grow=3</div>
36+
</div>
37+
38+
</body>
39+
</html>

flex-shrink.html

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
<style>
8+
.flex-container
9+
{
10+
display: flex;
11+
font-size: 30px;
12+
}
13+
.flex-grow1
14+
{
15+
flex-shrink: 2;
16+
}
17+
</style>
18+
</head>
19+
<body>
20+
<div class="flex-container">
21+
<!--flex-grow with flex shrink:0;-->
22+
<div class="flex-grow">Content one displaying flex</div>
23+
<div class="flex-grow1">Content one displaying flex</div>
24+
<!--flex-grow with flex shrink:0;-->
25+
<div class="flex-grow2">Content one displaying flex</div>
26+
<div class="flex-grow1">Content one displaying flex</div>
27+
<div class="flex-grow1">Content one displaying flex</div>
28+
<div class="flex-grow1">Content one displaying flex</div>
29+
<div class="flex-grow1">Content one displaying flex</div>
30+
<div class="flex-grow1">Content one displaying flex</div>
31+
</div>
32+
</body>
33+
</html>

0 commit comments

Comments
 (0)